Theming
Override semantic tokens once and every component follows — light, dark, and custom.
Semantic tokens
Components never reference raw colors. They read --iv_* tokens, grouped as surface/foreground pairs. Overriding a token restyles every component that uses it.
Try it: the controls below write to :root immediately. Nothing is persisted.
Override
src/app.css· css Show Hide
:root {
--iv_accent: #c7a24a;
--iv_accent-dim: #8a6f2f;
--iv_surface: #000000;
--iv_radius: 2px;
}theme.css, or scope them under :root — the theme uses :root and [data-theme], so later declarations win.Dark and light
Dark is the default. Light is applied by the OS preference, or forced with data-theme="light" on <html>. Set it before first paint to avoid a flash.
src/app.html — before %sveltekit.head%· html Show Hide
<script>
const stored = localStorage.getItem('theme');
const dark = stored ? stored === 'dark' : true;
document.documentElement.dataset.theme = dark ? 'dark' : 'light';
</script>Radius and density
--iv_radius derives the whole radius scale, so override --iv_radius-lg to change containers without touching the square controls. Spacing is a fixed 2–24px scale; --iv_spacing-lg sets the gap inside panels and forms.
Source· css Show Hide
:root {
--iv_radius-lg: 4px;
--iv_spacing-lg: 20px;
}Typography
The UI voice is IBM Plex Mono; Sora is reserved for headings and prose. Point the font tokens at self-hosted faces to drop the Google Fonts request.
Source· css Show Hide
@font-face {
font-family: 'Plex Mono Local';
src: url('/fonts/plex-mono.woff2') format('woff2');
font-display: swap;
}
:root {
--iv_font-mono: 'Plex Mono Local', monospace;
}Component scope
Tokens cascade. Set them on any container to theme a subtree, for example a dense panel.
Source· svelte Show Hide
<div class="dense">
<Button variant="primary">Save</Button>
</div>
<style>
.dense {
--iv_spacing-md: 8px;
--iv_radius: 0px;
}
</style>