-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fixed dark mode switch Button: Update DarkModeSwitch #5894
Fixed dark mode switch Button: Update DarkModeSwitch #5894
Conversation
Issue : 1. User sets dark theme and closes tab, 2. Again user visits cypress doc 3. Now the theme remains dark but button is stucked in light theme Fix: The default value is now set from localstorage. Resolution: Darkmode switch button now remembers the user set value
👷 Deploy request for cypress-docs pending review.Visit the deploys page to approve it
|
|
Setting the SetColor in useEffect so that it runs only on clien side.
Which browser were you having problems with (Browser / browser version / operating system)? For me with Google Chrome 127.0.6533.100 on Windows 11 and Google Chrome 127.0.6533.9 on Ubuntu |
Hi @MikeMcC399 , I am using google chrome on windows 11 Version 127.0.6533.100 (Official Build) (64-bit) i am getting issue on browser PFB : Steps Followed : Enabled Dark mode >> Close Tab/Browser >> Revisited the document >> Found the doc is in dark mode but the DarkModeSwitch Button is stuck in light mode |
Thanks for explaining and apologies for my misunderstanding! I misread the issue and see now the same problem you pointed out. The light / dark mode button should be aligned to the light/dark state of the site. |
No worries at all, glad we're on the same page now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TYTY
Could you check if this PR has solved this issue in production? I'm still seeing the switch in light mode when the site is displayed in dark mode. You can get the same effect if you press F5 when the site is in dark mode. The switch changes to light mode whilst the site stays in dark mode. |
Hi @MikeMcC399 , |
Thanks for confirming you are also seeing the issue unresolved in production! Unfortunately I don't have the expertise to debug further or to suggest a fix. |
Issue :
Fix:
The default value is now set from localstorage.
Resolution:
Darkmode switch button now remembers the user set value.