etchteam / storybook-addon-css-variables-theme

Change the CSS variable based design tokens in your storybook on the fly
MIT License
28 stars 12 forks source link

Please provide compatibility with vite and v7 docs page #42

Closed louia closed 1 year ago

louia commented 1 year ago

Hi,

Can you please provide compatibility with vite and storybook v7 ?

In the README.md there are only example for webpack config with css-loader or style-loader.

When I import stylesheet with vite, they are not lazyLoaded and load all the theme I imported.

The workaround provided in #20 works fine but it's not on the README.md...

The toggle button appear in the toolbar only for stories but not for the new "Docs" page in v7, it's possible to add an option to also add to it ?

DanWebb commented 1 year ago

The addon is compatible with storybook v7 and in latest storybook the theme switch is appearing on both the new docs page and canvas toolbar without any additional configuration necessary.

There's no plans to work on vite support as it's not something we use at the moment, but would welcome PRs.

https://github.com/etchteam/storybook-addon-css-variables-theme/issues/20 is only a workaround that has been reported to be unreliable so I don't think it'll be added to the readme.

I'm going to close this in favour of https://github.com/etchteam/storybook-addon-css-variables-theme/issues/20, vite support can be discussed there.