summaryrefslogtreecommitdiff
path: root/engine/Skin.php
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-07-10 01:30:05 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-07-10 23:53:02 +0300
commit1c524efbf7da91cb99bb4516feb514071e938495 (patch)
treee1fced0104749014db154f5d3b29881e705bfafc /engine/Skin.php
parent8979719a1af4bc0712407db7f95704f645f261a3 (diff)
dark theme support
Diffstat (limited to 'engine/Skin.php')
-rw-r--r--engine/Skin.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/engine/Skin.php b/engine/Skin.php
index 57f8b90..917eef7 100644
--- a/engine/Skin.php
+++ b/engine/Skin.php
@@ -23,11 +23,16 @@ class Skin {
else
$js = null;
+ $theme = ($_COOKIE['theme'] ?? 'auto');
+ if (!in_array($theme, ['auto', 'dark', 'light']))
+ $theme = 'auto';
+
$layout_ctx = new SkinContext('\\skin\\base');
$lang = $this->getLang();
$lang = !empty($lang) ? json_encode($lang, JSON_UNESCAPED_UNICODE) : '';
return new Response(200, $layout_ctx->layout(
static: $this->static,
+ theme: $theme,
title: $this->title,
opts: $this->options,
js: $js,