Replies: 2 comments
-
I was able to get Tailwind to work by adding a What does not work is using utility classes in the stories. I tried to change the module hook to add Happy for any feedback what I might be doing wrong. I can try to put together a StackBlitz environment demonstrating the issue. |
Beta Was this translation helpful? Give feedback.
-
I have no idea what I did differently, but it works now. 😱 Here's a playground: https://stackblitz.com/edit/github-3rwar8 |
Beta Was this translation helpful? Give feedback.
-
I created a Nuxt module based on https://github.com/nuxt/module-builder and placed a component in
src/runtime/components/MyBtn.vue
where I use some Tailwind classes.In the root I created a
histoire.config.ts
with the following config:In
src
I added a filehistoire-setup.ts
with the following content:In
src
I also added atailwind.css
with the following content:Finally, in
src
I also have aMyBtn.story.vue
that imports theMyBtn
component and the story uses Tailwind classes itself, too. However, none of the Tailwind classes work. Neither the ones in the component, nor the ones in the story.To check that everything is loaded properly, I added
html { background-color: lime; }
to thetailwind.css
and inspecting thehtml
element, I can see that the style is picked up, so thesetupFile
works and also thetailwind.css
is loaded.I also tried adding a
tailwind.config.ts
in the root with the following content, but it didn't help:Any idea what I am doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions