You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the page starts in dark mode, localStorage would not contain a theme value, so the second block there is called, and localStorage is set to dark meaning it works on the next click.
Agreed as well; I vaguely recall this being brought up before some time ago after the dark theme was first implemented. Yes, please send a PR, unless you'd prefer one of us to take care of it. Thanks!
hugovk
changed the title
Very minor bug with switching to light mode for the first time with dark mode preference
Bug with switching to light mode for the first time with dark mode preference
Apr 2, 2022
When on a system with
prefers-color-scheme
as dark mode, switching to light mode for the first time requires two clicks.The toggle colour scheme function:
peps/pep_sphinx_extensions/pep_theme/static/colour_scheme.js
Lines 19 to 27 in a4f0c14
If the page starts in dark mode,
localStorage
would not contain a theme value, so the second block there is called, and localStorage is set to dark meaning it works on the next click.I think changing it to this would fix the issue:
Would this be OK to PR?
The text was updated successfully, but these errors were encountered: