-
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
Conversation
document.documentElement.style.backgroundColor = computedStyles.getPropertyValue( | ||
"--primary-background-color" | ||
); | ||
|
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.
Should we add primary text color here as well?
Should fix #6814
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.
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 comment
The 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.
I tested it, and adding primary-text-color as well, does indeed fix that issue.
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.
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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move it to a new PR
@bramkragten For me I still have a white flash, but only in the area of the sidebar. |
@@ -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; |
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
Proposed change
Fixes white flash when device is in dark mode.
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: