Skip to content
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

sun/moon toggle button is hidden after installation #231

Open
cjxe opened this issue Mar 21, 2023 · 1 comment
Open

sun/moon toggle button is hidden after installation #231

cjxe opened this issue Mar 21, 2023 · 1 comment

Comments

@cjxe
Copy link

cjxe commented Mar 21, 2023

The problem

I installed and configured the "storybook-dark-mode" addon. The dark mode toggle button is only visible in incognito mode or other browsers.

✅ Current solution

Some data is saved in the Local Storage. I deleted that by right-clicking on some blank space > navigating to the Application tab > expanding the Local Storage tab and deleting it.

Potential solutions that failed

1- I did a hard refresh (shift + R).
2- I cleared browser cookies (even though none were related to localhost:6006).
3- Disabled all Chrome extensions.
4- Restarted the computer.

Config files

// .storybook.preview.js

import { themes } from '@storybook/theming';
import '../src/styles/globals.css';

const preview = {
  parameters: {
    darkMode: {
      current: 'dark',
      darkClass: 'dark',
      classTarget: 'html',
      stylePreview: true,
    },
    actions: { argTypesRegex: '^on[A-Z].*' },
    controls: {
      matchers: {
        color: /(background|color)$/i,
        date: /Date$/,
      },
    },
    layout: 'fullscreen',
  },
};

export default preview;

Environment

MacOS version: Monterey 12.6
Chrome version: 111.0.5563.64 (Official Build) (arm64)
Storybook version: Storybook 7.0.0-beta.57 for nextjs

--

An issue was previously opened regarding this but never resolved: #184

@cjxe cjxe changed the title sun/moon toggle button is hidden sun/moon toggle button is hidden after installation Mar 22, 2023
@mrowrpurr
Copy link

Thank you! I lost so many hours on this, uninstalling and re-installing the npm package and clearing my cache, etc.

Thank you, clearing Local Storage fixed it for me 🌞🌚

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants