Lab for Svelte 268 items

Theming

Change colors, fonts and radius with CSS variables, including dark mode.

Tokens

Components read optional --lab-* variables. Unset, each component uses its own fallback colors; set them to theme every component at once:

Token What it colors
--lab-ink Main text and icons
--lab-muted Secondary text
--lab-subtle Quiet fills behind rows and inputs
--lab-surface Cards, menus and panels
--lab-border Lines and outlines
--lab-focus The focus ring
--lab-danger, --lab-warning Error and warning text
--lab-red, --lab-orange, --lab-teal Accents in charts and illustrations
--lab-font, --lab-font-mono Text and code fonts
--lab-radius-sm, --lab-radius, --lab-radius-lg Corner radius
--lab-ease The easing curve for motion

Setting one replaces every component's own fallback for it, so set the tokens an app really maps:

:root {
	--lab-ink: var(--color-text-primary);
	--lab-surface: var(--color-background-card);
	--lab-radius: 10px;
}

Dark mode

Components switch to dark under data-theme="dark" or a .dark class on any ancestor, usually <html>.

One component

Each component also has variables of its own, named after its class, like --lab-spn-speed on .lab-spn. The component's notes list them under Motion or Theming.