-
Notifications
You must be signed in to change notification settings - Fork 314
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
Website Flashes White in Dark Mode #1857
Comments
Hey @Michael13435, thanks for opening an issue. See #1816 for more reference about local docs and this flashing behaviour (and thus would be a duplicate) |
This is on the website: https://pydata-sphinx-theme.readthedocs.io/en/stable/ more specifically I saw this happen on But it seems to affect anything with the pydata sphinx theme |
I can reproduce with our site after clearing cookies |
To further debug this are y'all using the |
I think that would need too big of a refactor, right now Js looks at prefers-color-scheme, and then switch a data attribute on html, so there will always be a js/css race until the attribute is set (you can also get a flash of dark website, is sys preference is dark and you want light). I think if we want to avoid this flash on auto mode we need to set the light/dark theme attribute only of there is a user pref and otherwise use
That would also let us not use a |
@Carreau's suggestion seems worth a try, it would maybe improve some of hte cases anyway. we could also try adding a transition time, maybe that would at least make the flash less abrupt? |
I think the problem is not that light-dark is abrupt, but that you are coding at night and get a white flash in the middle of the night. So it would almost be better for the default color to be dark. |
I think adding some transition time would be a good solution. I was mostly concerned about photosensitive individuals when making the post so I think some transition time would be helpful. Also just personally I would find it to be less harsh if it had a second or two to transition. This would also make the transition less harsh if default was dark mode, so I think its a good choice either way |
When Loading the website briefly flashes white in dark mode. This only happens the first time loading the website.
To induce this if you have accessed the website before clear cookies and reload.
The text was updated successfully, but these errors were encountered: