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

Compatibility issues with Storybook v8.2.6 #70

Closed eliasmohsengrenvald closed 2 months ago

eliasmohsengrenvald commented 2 months ago

Unfortunately, the theme switcher no longer shows up in Storybook v8.2.6, whereas it used to work fine up until v8.0.9

ella-etch commented 2 months ago

@eliasmohsengrenvald Hey! We’ve been having a look at this but haven’t been able to reproduce the issue. Do you have a minimal reproduction you could send?

eliasmohsengrenvald commented 2 months ago

Hi @ella-etch , I will wait for Storybook v8.3.0 and test it again and will try to make a minimal reproduction if I see that's still broken, will keep you posted

eliasmohsengrenvald commented 2 months ago

Hi @ella-etch , I just made a minimal reproduction with the v3 and I can actually see that the theme switcher is showing up on the toolbar, however, it doesn't really swap the theme, or perhaps I'm doing it wrong? https://github.com/eliasmohsengrenvald/css-variable-theme-storybook It looks like, it's due to the fact that the preset folder is no longer being shipped, as we used to do below where we imported the addon in order to get it working with Vite: '@etchteam/storybook-addon-css-variables-theme/dist/preset'

ella-etch commented 2 months ago

Hey @eliasmohsengrenvald,

We’re aware that others have had some compatibility issues with Vite - there’s an open issue here with some potential workarounds you could try: https://github.com/etchteam/storybook-addon-css-variables-theme/issues/20 I’ve managed to get the theme switcher in your reproduction working with both Storybook 8.0.9 and 8.2.6 using the workaround in this particular comment https://github.com/etchteam/storybook-addon-css-variables-theme/issues/20#issuecomment-1314810030

Could you see if any of those suggestions work for you?

eliasmohsengrenvald commented 2 months ago

Hi @ella-etch , Thanks a lot for sharing that and your quick answer, we did have something similar, however tweaking it to your recommended solution did the trick, and got it working! 🙏 so I close this ticket