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:
<span><span style="color: var(--shiki-token-keyword)">import</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">'../src/styles/global.css'</span></span>
<span></span>
And if you are using PostCSS 8+, remember to replace the PostCSS loader with the correct version using @storybook/addon-postcss.