Replies: 1 comment
-
Thanks alot it worked ❤️ The official documentation is very confusing, and I don't find it useful. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
There really is no good documentation or info on this so wanted to share how i got it to work so anyone else looking to use Tailwind with a Vite/Storybook project can try it how i got it to work.
This is assuming you've set a project up using Vite for Vue.js and then followed the installation process for Storybook.
I also used PNPM but im pretty sure you can follow along with NPM.
Tailwind uses PostCSS to compile your CSS. If you are using Vite, their are configuration mismatches between Storybook and Vite which make configuring Tailwind in a project tricky.
in your build in the .storybook folder, Add
import "../src/style.css";
into your preview.js file at the top.in your build in the .storybook folder, Add vue to your stories config in your main.js:
You can test if it works by adding a tailwind
class: border border-red-500
around the Vite HelloWorld number counter button and inspecting it.IMPORTANT Make sure you do this with the environments off and then run your pnpm(or npm) run dev and pnpm(or npm) run storybook after this has been done or it may not work while its all running.
Hope this helps!
Beta Was this translation helpful? Give feedback.
All reactions