Theming

Every color, radius and space is a --sve-* CSS variable. Override them anywhere — no rebuild, no config.

The token model

Components read --sve-* custom properties for every visual value. To theme, you set those variables — globally on :root or scoped to any element. There is no config file and no rebuild.

Overriding tokens

Set tokens globally:

app.css
:root {
  --sve-color-primary: #8b5cf6;
  --sve-color-primary-hover: #7c3aed;
  --sve-radius-md: 0.5rem;
}

…or scope them to a subtree:

App.svelte
<!-- Scope overrides to any subtree -->
<div style="--sve-color-primary: #10b981;">
  <Button color="primary">Emerald</Button>
</div>
Accent

Try the live accent sandbox on the home page.

Light & dark

ThemeProvider toggles a light/dark class that swaps the token set. One gotcha:

+layout.svelte
// Overlays portal to <body>. Mirror the theme class onto
// <body> so portaled content gets the right tokens.
$effect(() => {
  document.body.classList.toggle('dark', isDark);
  document.body.classList.toggle('light', !isDark);
});

Token reference

The most-used token families. Each semantic color has hover / active / foreground / surface / border variants.

TokenPurpose
--sve-color-primaryPrimary accent (+ secondary, success, warning, danger, default)
--sve-color-*-foregroundText/icon color on that surface
--sve-color-*-surfaceSubtle background tint (flat/ghost states)
--sve-radius-mdCorner radius (sm / md / lg / full)
--sve-space-*Spacing scale
--sve-font-family-sansBase font family (and -mono)