INSTALLATION · SVELTEKIT
Using SvelteKit
Register the Coordiation Vite adapter beside SvelteKit, scan the src tree, and load the generated stylesheet from the root layout.
The default scanner reads .svelte, JavaScript, TypeScript, HTML, Markdown, and MDX files without an additional extractor.
Install Coordiation
SvelteKit already includes Vite. Add the compiler and the official Vite adapter.
npm install -D @coordiation/css @coordiation/viteRegister both Vite plugins
Keep sveltekit() and add Coordiation as a pre-transform plugin.
import { sveltekit } from "@sveltejs/kit/vite";
import coordiation from "@coordiation/vite";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [
coordiation({
content: ["src"],
cssFile: "src/coordiation.css"
}),
sveltekit()
]
});Create the CSS entry
Use one watched stylesheet for framework generation and theme ownership.
@coordiation;
@co-theme {
--co-color-brand-500: oklch(62.3% 0.214 259.815);
}Load it from the root layout
A root layout keeps the generated stylesheet active across every SvelteKit route.
<script>
import "virtual:coordiation.css";
let { children } = $props();
</script>
{@render children()}Use utilities in components
Keep conditional variants as complete class strings so the compiler can discover them.
<main class="co-grid co-min-h-screen co-place-items-center co-bg-black co-text-white">
<h1 class="co-text-6xl co-font-bold">Built with Coordiation</h1>
</main>npm run dev
npm run buildPRODUCTION CHECKLIST
Ship predictable CSS
Keep the scanner boundary and generated stylesheet explicit so people, CI, and AI agents produce the same result.
Open SvelteKit documentation →- Import
virtual:coordiation.cssonly once from the highest shared layout. - Keep component libraries inside the configured
contentboundary. - Map Svelte conditional classes to complete strings or add the finite set to a safelist.
- Validate the adapter with the same
npm run buildcommand used by your deployment target.
