mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Fix white flash in dark mode (#6815)
This commit is contained in:
parent
bb2462483e
commit
e5c386c39a
@ -48,7 +48,7 @@
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
html {
|
||||
background-color: var(--primary-background-color, #111111);
|
||||
background-color: #111111;
|
||||
}
|
||||
#ha-init-skeleton::before {
|
||||
background-color: #1c1c1c;
|
||||
|
@ -88,9 +88,15 @@ export default <T extends Constructor<HassBaseEl>>(superClass: T) =>
|
||||
}
|
||||
|
||||
const themeMeta = document.querySelector("meta[name=theme-color]");
|
||||
const headerColor = getComputedStyle(
|
||||
document.documentElement
|
||||
).getPropertyValue("--app-header-background-color");
|
||||
const computedStyles = getComputedStyle(document.documentElement);
|
||||
const headerColor = computedStyles.getPropertyValue(
|
||||
"--app-header-background-color"
|
||||
);
|
||||
|
||||
document.documentElement.style.backgroundColor = computedStyles.getPropertyValue(
|
||||
"--primary-background-color"
|
||||
);
|
||||
|
||||
if (themeMeta) {
|
||||
if (!themeMeta.hasAttribute("default-content")) {
|
||||
themeMeta.setAttribute(
|
||||
|
Loading…
x
Reference in New Issue
Block a user