1
Add Tailwind
Use the
sv CLI to add Tailwind CSS to your project.2
Add dependencies
Add the following dependencies to your project:
3
Add icon library
Install
@lucide/svelte:4
Configure path aliases
If you are using SvelteKit and are not using the default alias If you are not using SvelteKit, then you’ll need to update your path aliases in your
$lib, you’ll need to update your svelte.config.js file to include those aliases.svelte.config.js
tsconfig.json and vite.config.ts.tsconfig.json
vite.config.ts
5
Configure styles
Add the following to your global CSS file. You can learn more about using CSS variables for theming in the theming section.Feel free to add or modify as needed to suit your project.
src/routes/layout.css
6
Configure utils
You’ll want to create a
cn helper to make it easier to conditionally add and merge Tailwind CSS classes.src/lib/utils.ts
7
Import styles to your app
Create
src/routes/+layout.svelte and import the styles:src/routes/+layout.svelte
8
That's it
You can now start adding components to your project.