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

screen flickers on load w/dark mode enabled #37

Open
EverlastingBugstopper opened this issue Mar 15, 2022 · 1 comment
Open

screen flickers on load w/dark mode enabled #37

EverlastingBugstopper opened this issue Mar 15, 2022 · 1 comment

Comments

@EverlastingBugstopper
Copy link
Contributor

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
@EverlastingBugstopper
Copy link
Contributor Author

EverlastingBugstopper commented Jun 23, 2022

i think we could eliminate most of these flickers if we duplicated the dark mode styles and nested it in this media-query:

@media (prefers-color-scheme: dark)

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant