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