diff options
Diffstat (limited to 'lib/classes/PageLayout.php')
| -rw-r--r-- | lib/classes/PageLayout.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/classes/PageLayout.php b/lib/classes/PageLayout.php index c4d0f6c..94bc133 100644 --- a/lib/classes/PageLayout.php +++ b/lib/classes/PageLayout.php @@ -161,6 +161,11 @@ class PageLayout URLHelper::setBaseURL($old_base); } + + self::addHeadElement('link', [ + 'rel' => 'stylesheet', + 'href' => Assets::url('stylesheets/theme.php') + ]); } /** @@ -271,6 +276,28 @@ class PageLayout } /** + * Add CSS variables to the :root selector in the HTML HEAD section. + * + * @param array $variables Associative array of CSS variable names and values. + */ + public static function addRootStyle(array $variables) + { + if (empty($variables)) { + return; + } + + $style = ':root {' . PHP_EOL; + foreach ($variables as $name => $value) { + $style .= " --$name: $value;" . PHP_EOL; + } + $style .= '}' . PHP_EOL; + + // Add the <style> tag with the generated CSS to the head + self::addHeadElement('style', [], $style); + } + + + /** * Add a STYLE element to the HTML HEAD section. * * @param string $content element contents |
