This is an adder for svelte-add
; you should read its README
before continuing here.
This adder's codename is tailwindcss
, and can be used like so:
npx svelte-add@latest tailwindcss
This adder supports SvelteKit and Vite-powered Svelte apps (all the environments svelte-add
currently supports).
-
forms
(defaultfalse
): whether or not to install and set up the Tailwind CSS Forms plugin. -
typography
(defaultfalse
): whether or not to install and set up the Tailwind CSS Typography plugin. -
daisyui
(defaultfalse
): whether or not to install and set up daisyUI as a Tailwind plugin.
npx svelte-add@latest tailwindcss --tailwindcss-forms --tailwindcss-typography --tailwindcss-daisyui
After the adder runs,
-
You can use Tailwind utility classes like
bg-blue-700
in the markup (components, routes,app.html
). -
You can use Tailwind directives like
@apply
and@screen
or use thetheme
function in Sveltestyle lang="postcss"
blocks or thesrc/app.pcss
file. -
You can configure Tailwind in the
tailwind.config.cjs
file. -
Your Tailwind CSS will be purged for production builds.