-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
Dark theme blinks on refresh #1995
Comments
Yeah we're aware of this issue. It's because the theme is only applied after page load, that's why we see the flash. It's a little annoying but possible to fix - gatsbyjs.org doesn't have this issue. |
A good example where there is no such issue - https://overreacted.io/ (yeah, powered by Gatsby). |
Try reading this https://github.com/donavon/use-dark-mode/blob/develop/README.md#that-flash To fix this, we need a setbody hooks to inject script into html body. So that it wont wait till React load to actually enter dark mode |
🐛 Bug Report
When loading a page with dark mode turned on, a light theme is visible for a while before the previously selected dark theme is applied.
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
Expected behavior
A dark theme should be shown right away
Actual Behavior
For a second or so, a "regular" light theme is showed, and only then a dark theme:
The text was updated successfully, but these errors were encountered: