From: Alexander Ebert Date: Wed, 18 Oct 2023 16:49:54 +0000 (+0200) Subject: Fix the `theme-color` in the admin panel X-Git-Tag: 6.0.1_dev_1~3^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9d33f2ded85c07ee9da863098ca741347f93201e;p=GitHub%2FWoltLab%2FWCF.git Fix the `theme-color` in the admin panel --- diff --git a/wcfsetup/install/files/acp/templates/header.tpl b/wcfsetup/install/files/acp/templates/header.tpl index dde2ef0721..d85f3bf8d5 100644 --- a/wcfsetup/install/files/acp/templates/header.tpl +++ b/wcfsetup/install/files/acp/templates/header.tpl @@ -23,14 +23,27 @@ - {else} - {/if} + @@ -49,13 +62,6 @@ {* This constant is a compiler option, it does not exist in production. *} {* Unlike the frontend, this option must be defined in the ACP at all times. *} var COMPILER_TARGET_DEFAULT = true; - - {if $__wcf->getStyleHandler()->getColorScheme() === 'system'} - { - const colorScheme = matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; - document.documentElement.dataset.colorScheme = colorScheme; - } - {/if} diff --git a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php index 16b917d2fa..9cd20e687a 100644 --- a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php +++ b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php @@ -433,6 +433,9 @@ final class StyleCompiler extends SingletonFactory $variables = $this->prepareVariables($variables); + // The theme color implicitly matches the header background color. + $variables['wcfPageThemeColor'] = 'var(--wcfHeaderBackground)'; + $scss = "/*!\n\nstylesheet for the admin panel, generated on " . \gmdate('r') . " -- DO NOT EDIT\n\n*/\n"; $scss .= $this->bootstrap($variables); foreach ($files as $file) {