From 19f94ff8cc24ac39b726c89482a82cd830a45eb9 Mon Sep 17 00:00:00 2001 From: Adam Kapos Date: Wed, 22 May 2024 16:26:13 +0300 Subject: [PATCH] Fix app-theme-color not following header color (#20758) * Fix app-theme-color not following header color * Revert incorrect fix for #20671 that only applies when a primary color is set by the user --- src/common/dom/apply_themes_on_element.ts | 7 +++++-- src/resources/styles-data.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/common/dom/apply_themes_on_element.ts b/src/common/dom/apply_themes_on_element.ts index ee977cb49806..cf431b6cb8ad 100644 --- a/src/common/dom/apply_themes_on_element.ts +++ b/src/common/dom/apply_themes_on_element.ts @@ -61,8 +61,11 @@ export const applyThemesOnElement = ( const accentColor = themeSettings?.accentColor; if (darkMode && primaryColor) { - themeRules["app-theme-color"] = hexBlend(primaryColor, "#121212", 8); - themeRules["app-header-background-color"] = themeRules["app-theme-color"]; + themeRules["app-header-background-color"] = hexBlend( + primaryColor, + "#121212", + 8 + ); } if (primaryColor) { diff --git a/src/resources/styles-data.ts b/src/resources/styles-data.ts index 77bde2fcb1b8..7c51d1fb01ff 100644 --- a/src/resources/styles-data.ts +++ b/src/resources/styles-data.ts @@ -102,7 +102,7 @@ export const derivedStyles = { "mdc-theme-error": "var(--error-color)", "app-header-text-color": "var(--text-primary-color)", "app-header-background-color": "var(--primary-color)", - "app-theme-color": "var(--primary-color)", + "app-theme-color": "var(--app-header-background-color)", "mdc-checkbox-unchecked-color": "rgba(var(--rgb-primary-text-color), 0.54)", "mdc-checkbox-disabled-color": "var(--disabled-text-color)", "mdc-radio-unchecked-color": "rgba(var(--rgb-primary-text-color), 0.54)",