-
Notifications
You must be signed in to change notification settings - Fork 51
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
screen flickers on load w/dark mode enabled #37
Comments
i think we could eliminate most of these flickers if we duplicated the dark mode styles and nested it in this media-query:
then it would only flicker if the system preferences preferred light and they had set it dark on this site (which is likely rare). i implemented dark mode for my own website a while back - source here: css, js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
my guess is that there's some client-side JS that determines if a user wants dark mode, and then it will run an animation transitioning from light mode to dark mode. unfortunately that animation looks a little bit flickery and on reloads it doesn't seem to remember that you're on dark mode. it keeps running that client-side JS and animation sequence every time. This isn't urgent but thought I'd document the issue here 😄
in my video i'm doing hard refreshes to more clearly show the animation, it's a bit quicker on regular reloads (presumably because there's some sort of caching) but the animation is still there, albeit a bit less noticeable.
dark-mode-flicker.mp4
The text was updated successfully, but these errors were encountered: