SvelteKit + Tailwind CSS
Utility-first CSS (v4). This page shows exactly what pickstack adds to a SvelteKit project for Tailwind CSS: the packages, the new files and the changes to existing ones. Every combination is installed, built, linted and tested in CI.
$ npm create pickstack@latest my-app -- --framework sveltekit --modules tailwind --yesCustomize in the configurator
Packages it adds
| Package | Version | Type |
|---|---|---|
@tailwindcss/vite | ^4.3.5 | dev |
tailwindcss | ^4.3.5 | dev |
Changes to existing files
⋯ 1 unchanged lines let count = $state(0); </script> +<div+ class="rounded-2xl bg-white p-8 text-center shadow-sm ring-1 ring-slate-200"+>+ <p class="text-5xl font-bold tabular-nums">{count}</p>+ <div class="mt-6 flex justify-center gap-3">+ <button+ type="button"+ class="rounded-lg bg-slate-900 px-4 py-2 text-white hover:bg-slate-700"+ onclick={() => count--}+ >+ -1+ </button>+ <button+ type="button"+ class="rounded-lg bg-slate-900 px-4 py-2 text-white hover:bg-slate-700"+ onclick={() => count++}+ >+ +1+ </button>−<div class="card">− <p class="count">{count}</p>− <div class="row">− <button type="button" class="btn" onclick={() => count--}>-1</button>− <button type="button" class="btn" onclick={() => count++}>+1</button> </div> </div>
⋯ 5 unchanged lines let { children }: LayoutProps = $props(); </script> +<main+ class="flex min-h-screen flex-col items-center justify-center gap-8 bg-slate-50 p-8 text-slate-900"+>+ <nav class="flex gap-4 text-sm font-medium">+ <a class="text-slate-600 hover:text-slate-900" href={resolve("/")}>Home</a>+ <a class="text-slate-600 hover:text-slate-900" href={resolve("/about")}>+ About+ </a>−<main class="app">− <nav class="nav">− <a class="link" href={resolve("/")}>Home</a>− <a class="link" href={resolve("/about")}>About</a> </nav> {@render children()} </main>⋯ 1 unchanged lines
⋯ 1 unchanged lines import Counter from "#lib/Counter.svelte"; </script> +<section class="flex flex-col items-center gap-6">+ <h1 class="text-3xl font-bold tracking-tight">my-app</h1>−<section class="page">− <h1 class="title">my-app</h1> <Counter /> </section>
+<section class="flex flex-col items-center gap-6">+ <h1 class="text-3xl font-bold tracking-tight">About</h1>+ <p class="max-w-md text-center text-slate-600">+ Built with SvelteKit, Svelte 5, TypeScript, Tailwind CSS.+ </p>−<section class="page">− <h1 class="title">About</h1>− <p class="text">Built with SvelteKit, Svelte 5, TypeScript.</p> </section>
+@import "tailwindcss";−:root {− font-family: system-ui, sans-serif;− color: #0f172a;− background: #f8fafc;−} −body {− margin: 0;−}− −.app {− min-height: 100vh;− display: flex;− flex-direction: column;− align-items: center;− justify-content: center;− gap: 2rem;− padding: 2rem;− box-sizing: border-box;−}− −.title {− font-size: 1.875rem;− margin: 0;−}− −.nav {− display: flex;− gap: 1rem;−}− −.link {− color: #475569;− text-decoration: none;− font-weight: 500;−}− −.link:hover {− color: #0f172a;−}− −.page {− display: flex;− flex-direction: column;− align-items: center;− gap: 1.5rem;−}− −.text {− max-width: 28rem;− text-align: center;− color: #475569;−}− −.card {− background: #fff;− padding: 2rem;− border-radius: 1rem;− box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);− text-align: center;−}− −.count {− font-size: 3rem;− font-weight: 700;− margin: 0;− font-variant-numeric: tabular-nums;−}− −.row {− margin-top: 1.5rem;− display: flex;− justify-content: center;− gap: 0.75rem;−}− −.btn {− background: #0f172a;− color: #fff;− border: 0;− border-radius: 0.5rem;− padding: 0.5rem 1rem;− font: inherit;− cursor: pointer;−}− −.btn:hover {− background: #334155;−}−
import adapter from "@sveltejs/adapter-static"; import { sveltekit } from "@sveltejs/kit/vite";+import tailwindcss from "@tailwindcss/vite"; import { defineConfig } from "vite"; export default defineConfig({ plugins: [+ tailwindcss(), sveltekit({ compilerOptions: { // Force runes mode for the project, except for libraries. Can be removed in svelte 6.⋯ 8 unchanged lines
Project files
.gitignoreREADME.mdpackage.jsonsrc/app.d.tssrc/app.htmlsrc/lib/Counter.sveltesrc/lib/index.tssrc/routes/+layout.sveltesrc/routes/+layout.tssrc/routes/+page.sveltesrc/routes/about/+page.sveltesrc/routes/layout.cssstatic/robots.txttsconfig.jsonvite.config.ts