v1.3.0 28

Design System

Palette, semantic tokens and components — and how themes and dark mode change them.

How It Works

  1. 1 · Palette

    Raw scales, 50–950

  2. 2 · Semantic tokens

    Roles, named by meaning

    brand-fill → blue-500

    surface-card → white · grey-950

  3. 3 · Components

    Read only the roles

    Active

The Default Theme

Needs no attribute. A custom theme gets its own data-theme.

Default data-theme="default"
Onest, system-ui, sans-serif
16px

Dark Mode

Add .dark to <html>; every role switches.

Analytics overview

Revenue is up 12% this week.

Switch and remember the mode
<!-- Toggle dark mode -->
<script>
  function toggleDarkMode() {
    const html = document.documentElement;
    html.classList.toggle('dark');
    localStorage.setItem('theme', html.classList.contains('dark') ? 'dark' : 'light');
  }
</script>

<!-- Restore on page load (put in <head>) -->
<script>
  const mode = localStorage.getItem('theme');
  if (mode === 'dark' ||
      (!mode && matchMedia('(prefers-color-scheme: dark)').matches)) {
    document.documentElement.classList.add('dark');
  }
</script>

Custom Theme

Build one in Studio, or write the JSON.

json
  1. Create themes/my-theme.json
  2. Run the build
  3. Apply it with data-theme="my-theme"
{
  "name": "my-theme",
  "label": "My Theme",
  "fontFamily": "Poppins, system-ui, sans-serif",
  "radius": { "sm": "8px", "lg": "12px", "xl": "16px", "2xl": "20px", "3xl": "24px" },
  "colors": {
    "foregroundPrimary": "240 3% 6%",
    "surfacePage": "0 0% 98%",
    "surfaceCard": "0 0% 100%",
    "borderDefault": "0 5% 92%",
    "infoFill": "219 88% 54%",
    ...
  },
  "dark": { "colors": { "foregroundPrimary": "0 0% 98%", ... } }
}

Theme Exports

The Default theme in portable formats.

Theme CSS variables Tailwind v4 Design Tokens (DTCG) theme.json
default default.vars.css default.tailwind.css default.tokens.json default.json
  • *.vars.css — plain custom properties, light and dark
  • *.tailwind.css — a Tailwind v4 @theme
  • *.tokens.json — W3C Design Tokens, for Style Dictionary and Tokens Studio
  • *.json — Veritheme's theme.json, for Studio and the Figma plugin

Override Order

Later layers win.

#LayerSetsChanged by
1 Theme Font, radius, color roles data-theme
2 Dark mode Color roles for dark .dark
3 Components Read the roles Variant classes
4 Utilities Layout Your markup

Token Reference