hipstersmoothie / storybook-dark-mode

A storybook addon that lets your users toggle between dark and light mode.
MIT License
429 stars 56 forks source link

Custom themes not applied in the manager (Storybook 7/vitejs) #216

Closed fauxparse closed 1 year ago

fauxparse commented 1 year ago

I'm defining custom themes based on the default SB themes, but they're not being applied. In preview.ts I have:

export const parameters = {
  actions: { argTypesRegex: '^on[A-Z].*' },
  controls: {
    matchers: {
      color: /(background|color)$/i,
      date: /Date$/,
    },
  },
  darkMode: {
    dark, // my dark theme
    light, // my light theme
  },
};

...but it's just applying the default SB light and dark themes. I can see by looking at localStorage that the default themes are being written there; clearing localStorage and restarting storybook doesn't help.

hipstersmoothie commented 1 year ago

In general this plugin doesn't work with v7 yet. closing in favor of #205