mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Ensure current active dark modes gets used for manually set themes (#10307)
This commit is contained in:
parent
f1cb21e7fc
commit
bdb3c04037
@ -113,12 +113,6 @@ export class HassioMain extends SupervisorBaseElement {
|
|||||||
: this.hass.themes.default_theme);
|
: this.hass.themes.default_theme);
|
||||||
|
|
||||||
themeSettings = this.hass.selectedTheme;
|
themeSettings = this.hass.selectedTheme;
|
||||||
if (themeSettings?.dark === undefined) {
|
|
||||||
themeSettings = {
|
|
||||||
...this.hass.selectedTheme,
|
|
||||||
dark: this.hass.themes.darkMode,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
themeName =
|
themeName =
|
||||||
(this.hass.selectedTheme as unknown as string) ||
|
(this.hass.selectedTheme as unknown as string) ||
|
||||||
|
@ -36,7 +36,15 @@ export const applyThemesOnElement = (
|
|||||||
let cacheKey = selectedTheme;
|
let cacheKey = selectedTheme;
|
||||||
let themeRules: Partial<ThemeVars> = {};
|
let themeRules: Partial<ThemeVars> = {};
|
||||||
|
|
||||||
if (themeSettings) {
|
// If there is no explicitly desired dark mode provided, we automatically
|
||||||
|
// use the active one from hass.themes.
|
||||||
|
if (!themeSettings || themeSettings?.dark === undefined) {
|
||||||
|
themeSettings = {
|
||||||
|
...themeSettings,
|
||||||
|
dark: themes.darkMode,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (themeSettings.dark) {
|
if (themeSettings.dark) {
|
||||||
cacheKey = `${cacheKey}__dark`;
|
cacheKey = `${cacheKey}__dark`;
|
||||||
themeRules = { ...darkStyles };
|
themeRules = { ...darkStyles };
|
||||||
@ -86,7 +94,6 @@ export const applyThemesOnElement = (
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Custom theme logic (not relevant for default theme, since it would override
|
// Custom theme logic (not relevant for default theme, since it would override
|
||||||
// the derived calculations from above)
|
// the derived calculations from above)
|
||||||
|
@ -91,12 +91,6 @@ class SupervisorErrorScreen extends LitElement {
|
|||||||
: this.hass.themes.default_theme);
|
: this.hass.themes.default_theme);
|
||||||
|
|
||||||
themeSettings = this.hass.selectedTheme;
|
themeSettings = this.hass.selectedTheme;
|
||||||
if (themeName === "default" && themeSettings?.dark === undefined) {
|
|
||||||
themeSettings = {
|
|
||||||
...this.hass.selectedTheme,
|
|
||||||
dark: this.hass.themes.darkMode,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
themeName =
|
themeName =
|
||||||
(this.hass.selectedTheme as unknown as string) ||
|
(this.hass.selectedTheme as unknown as string) ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user