diff options
Diffstat (limited to 'engine/Skin.php')
-rw-r--r-- | engine/Skin.php | 5 |
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, |