3

I'm setting up a NextJS project with Tailwind and Storybook. The MDX styling doesn't work after importing Tailwind CSS

Before importing Tailwind

enter image description here

After importing Tailwind

enter image description here

What I did

The Tailwind CSS is being added to the storybook by following the answer at this link

.storybook/main.js

// Remove this code, MDX is working fine but Tailwind isn't
{
  name: '@storybook/addon-postcss',
  options: {
    postcssLoaderOptions: {
      implementation: require('postcss'),
    },
  },
},,

Full code demo: https://github.com/tanwanjern/next-storybook-demo

Question:

How can I make Tailwind and MDX styling work together in Storybook? And which Storybook add-ons are not necessary so that I can remove them?

vldmrrdjcc
  • 2,082
  • 5
  • 22
  • 41
Lester
  • 701
  • 1
  • 9
  • 47

0 Answers0