question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to switch theme back to "light"

See original GitHub issue

Describe 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:

  1. Clone the Storybook Design System project.
  2. Go to SB config.js and import { themes } from '@storybook/theming';
  3. Set options: { theme: themes.dark } to show the dark theme
  4. 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:closed
  • Created 4 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ndelangencommented, May 20, 2019

@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.

0reactions
shilmancommented, Mar 23, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found