-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquark-custom.php
More file actions
35 lines (31 loc) · 817 Bytes
/
quark-custom.php
File metadata and controls
35 lines (31 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
namespace Grav\Theme;
use Grav\Common\Theme;
class QuarkCustom extends Quark
{
/**
* @return array
*/
public static function getSubscribedEvents()
{
return [
'onTwigSiteVariables' => ['onTwigSiteVariables', 0]
];
}
/**
* Add theme assets globally
*
* @return void
*/
public function onTwigSiteVariables()
{
// Add FontAwesome Globally
if ($this->config->get('theme.include_fontawesome')) {
$this->grav['assets']->add('theme://css/fontAwesome.css');
}
if ($this->config->get('theme.dark_mode')) {
$this->grav['assets']->add('theme://css/darkMode.css');
$this->grav['assets']->addJs('theme://js/darkMode.js', ['group' => 'bottom']);
}
}
}