Skip to main content

Adding Tailwind to Svelte project (Vite)

Just use svelte-add:

BASH
npx svelte-add@latest tailwindcss


Note that sometimes there's an issue with vite.config.js where the plugins[] block already has a tailwind config populated. In that case, just do something like this to use tailwind.config.cjs:

Not sure if this will make postcss use the postcss config file...


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.