I am trying to build my storybook with tailwind css. When running build-storybook
the components are rendered with the tailwind classes. Unfortunately, when I build storybook and run the create build storybook-static
with npx http-server storybook-static
the classes are not loaded into the stories and the components are displayed not styled.
This is a repro repo of my project: https://gitlab.com/ens.evelyn.development/storybook-issue
This is my main.js
:
const path = require('path')
module.exports = {
"stories": [
"../src/components/**/**/*.stories.mdx",
"../src/components/**/**/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials",
{
name: '@storybook/addon-postcss',
options: {
postcssLoaderOptions: {
implementation: require('postcss'),
},
},
},
"@storybook/addon-actions",
"storybook-tailwind-dark-mode"
]}
My Projectstructure looks like this:
.storybook
src
components
subdir
Button
index.tsx
button.stories.js
styles
index.css (<-- tailwindcss file)
Any hints or advice is very appreciated.