Skip to content
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

Merged
merged 1 commit into from
Sep 7, 2020
Merged

Fix white flash in dark mode #6815

merged 1 commit into from
Sep 7, 2020

Conversation

bramkragten
Copy link
Member

Proposed change

Fixes white flash when device is in dark mode.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

document.documentElement.style.backgroundColor = computedStyles.getPropertyValue(
"--primary-background-color"
);

Copy link
Member

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

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member Author

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...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Member Author

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 bramkragten merged commit e5c386c into dev Sep 7, 2020
@bramkragten bramkragten deleted the fix-white-flash-dark-mode branch September 7, 2020 16:19
@spacegaier
Copy link
Member

@bramkragten For me I still have a white flash, but only in the area of the sidebar.

140B3728-9F3E-4969-A51C-33F6B715F884

@@ -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;
Copy link
Member

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?

Copy link
Member Author

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

@bramkragten bramkragten mentioned this pull request Sep 7, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants