-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix white flash in dark mode #6815
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add primary text color here as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Help me, why is that happening now? The theme is loaded in onboarding right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For me, I have seen it when I have set dark for localhost then spin up a fresh dev container. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to know the source, can you reproduce it and check for errors? It is working fine here... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's move it to a new PR |
||
if (themeMeta) { | ||
if (!themeMeta.hasAttribute("default-content")) { | ||
themeMeta.setAttribute( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why this is not also
#111111
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the header bar