Open danlourenco opened 1 year ago
Just install the following module: @storybook/addon-styling
And push it to your addons section:
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
{
name: '@storybook/addon-styling',
options: {
postCss: true,
},
},
'storybook-addon-nuxt'
],
And then just import it inside your .storybook/preview.ts import '../assets/css/tailwind.css';
@prnews-io I was doing just that, except in my preview.js
file, I was importing the following:
import "tailwindcss/tailwind.css";
import "~/assets/css/main.css";
The tailwind.css
file does not exist in the assets folder, and also I thought the options/postCss flag was unnecessary as that appears to be specific to webpack builds.
Thanks for using the addon, and sorry for the late reply. I just started exploring how to make Tailwindcss available in a simple setup. I will let you know if there are any further improvements.
@danlourenco any solution did you find ?
i got solution
post.config.js
filepostcss-import
in post.config.js
https://github.com/tailwindlabs/tailwindcss/discussions/5934#discussioncomment-4897960I made a pr https://github.com/hirotaka/storybook-addon-nuxt/pull/23
this merges nuxt postcss config (also tailwind when using the nuxt tailwind addon) into storybook config.
You do not need @storybook/addon-styling
or a custom postcss.config.js
Hi there,
Great job with this addon! Wondering if this has been tested with Tailwind? I've followed whatever documentation I could find on Storybook 7 + Tailwind 3, but I can't get my Tailwind css to actually load in my stories. Any ideas?