ben-rogerson / twin.macro

🦹‍♂️ Twin blends the magic of Tailwind with the flexibility of css-in-js (emotion, styled-components, solid-styled-components, stitches and goober) at build time.
MIT License
7.89k stars 184 forks source link

Twin.macro syntax doesnt works on Storybook #785

Closed seongminn closed 1 year ago

seongminn commented 1 year ago

I'm using React 18 / vite / tailwindcss / twin.macro / storybook. But It doesn’t work with this Error.

image

I think It is because the storybook doesn't recognize syntax of twin.macro, tw. It works well when I don't use twin.macro syntax(tw).

I really really wanna solve this error and try to do UI component testing with storybook & twin.macro. Please Help me.🥲🥲

this is my vite.config.ts
this is my main.cjs
this is my package.json
ben-rogerson commented 1 year ago

You may need to set the babel config for storybook in your main.cjs. Check the emotion storybook example for the config.

seongminn commented 1 year ago

It works well now🥲

Thank you so much!!!