TailwindCSS in Storybook not working?

If you are wondering why your Tailwind styling wont show up in Storybook, it might be because you have forgotten to import Tailwind. I might have forgotten to do this just now...

At the top of .storybook/preview.js, add an import to your CSS file where you import Tailwind. In my case it would look like the following:

import '../src/styles/global.css'

And if you are using PostCSS 8+, remember to replace the PostCSS loader with the correct version using @storybook/addon-postcss.

Reply via emailBuy me a coffee

Join the newsletter

Every two weeks, I send an email about things that interest me, things I have built and things I have learned.

Previous issues