Unable to switch theme back to "light"
See original GitHub issueDescribe the bug
I’m unable to switch the theme back to “light” after using the dark theme. The only resolution is the localstorage.clear()
hack.
To Reproduce Steps to reproduce the behavior:
- Clone the Storybook Design System project.
- Go to SB config.js and
import { themes } from '@storybook/theming';
- Set
options: { theme: themes.dark }
to show the dark theme - Comment out above and refresh. It shows dark theme (but should go back to light). And when I set it manually to
themes.light
it does not refresh either.
Expected behavior When I do not set a theme it should reset the theme.
Screenshots Here’s a 📹video of this behavior.
System:
- OS: Mac OS
- Device: Macbook Pro 2018
- Browser: Chrome, safari
- Framework: React
- Version: 5.2.x
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Can't switch dark mode to light mode - Apple Community
Well I got it to work by turning off true tone then turning it back on. THEN click light mode and it switched...
Read more >Cant change the app mode from dark to light. My screen is ...
Go to Start > Settings > Personalization > Colors, scroll down to Choose Your App Mode and change to Light. Also at the...
Read more >How get Google Chrome Dark Mode change back to normal 1 ...
Click on the gray button Reset to default theme to get back your default Chrome theme. 2. For darker or lighter web content...
Read more >How to change back to light mode : r/chrome - Reddit
go here and at the top it should say "Force Dark Mode for Web Contents". Go to the drop-down next to it and...
Read more >My phone suddenly switched to dark mode and the setting ...
How do I switch back? I tried changing the settings, but the dark/light theme option is permanently set to dark.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Saifadin one recommendation I can give right now, is to not have the 2 storybooks share the same port.
I’ll implement #6806 (hopefully soon), which will remove the need to cache the theme in localStorage all-together.
Yowza!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-alpha.28 containing PR #9076 that references this issue. Upgrade today to try it out!
You can find this prerelease on the
@next
NPM tag.Closing this issue. Please re-open if you think there’s still more to do.