isak.me - a blog by isak solheim

Bi-weekly updates about things that interest me, things I have built and things I have learned.

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.