Platform
← Foundations

FOUNDATIONS FEATURE

The token contract

One fixed set of design tokens (surfaces, text, accent, state, border, radius, motion, type) that every skin emits for light and dark. Skins decide values.

Live demo
Surfaces
page
panel
raised
sunken
Accent & text
brand
text
muted
State
success
warning
danger
info
Border & radius
subtle
strong
radius-lg
pill

Every swatch is a real --ui-* token. Toggle the colour mode in the header — the whole contract repaints from one declaration per token.

~41 tokens Light and dark by contract 8 token families

The token contract

A skin is not a stylesheet — it is a set of values for a fixed contract. Every Semitexa skin emits the same design tokens as CSS custom properties, so a component can reference --ui-accent-brand and be certain it exists, in light and dark, in every skin. The contract is the stable seam between "what it looks like" (the skin) and "what it is" (the component).

Eight families

The contract groups into eight token families:

  • Surfaces — --ui-surface-page, --ui-surface-panel, --ui-surface-raised, --ui-surface-sunken
  • Text — --ui-text-primary, --ui-text-muted, --ui-text-on-accent
  • Accent — --ui-accent-brand (and secondary)
  • State — --ui-state-success, --ui-state-warning, --ui-state-danger
  • Border — --ui-border-subtle, --ui-border-strong
  • Radius — --ui-radius-sm/md/lg, plus none and pill
  • Motion — --ui-motion-duration-*
  • Type — --ui-font-sans, --ui-font-mono

Each token is emitted with light-dark(…, …), so a single declaration carries both modes and the colour-mode toggle repaints the whole UI by switching one attribute. The swatches above are real tokens — flip the theme and watch the contract repaint.

Because every skin fills the same slots, re-theming is swapping one tokens.css, light/dark is two value sets of one contract, and multi-tenant theming is a lookup — all without touching a component. This is the substrate the token-driven UI pillar builds on.

© Linus Torvalds:"Talk is cheap. Show me the code."

one token, both modesImplementation slice
/* a skin's tokens.css — one contract, both modes per token */:root {  color-scheme: light dark;  --ui-surface-page:  light-dark(#eee7d6, #10161d);  --ui-surface-panel: light-dark(#faf6ec, #161e27);  --ui-text-primary:  light-dark(#213540, #edf4f0);  --ui-accent-brand:  light-dark(#2f5e52, #8cc3a8);  --ui-state-danger:  light-dark(#b14e49, #d85f57);  /* …surfaces · text · accent · state · border · radius · motion · type… */}/* a component only ever speaks the contract — never a literal: */.thing { background: var(--ui-surface-panel); color: var(--ui-text-primary); }

How it works

The contract groups into eight families: surfaces (`--ui-surface-page/panel/raised/sunken`), text (`--ui-text-primary/muted/on-accent`), accent (`--ui-accent-brand`…), state (`--ui-state-success/warning/danger`), border (`--ui-border-subtle/strong`), radius (`--ui-radius-sm/md/lg`…), motion (`--ui-motion-duration-*`) and type (`--ui-font-sans/mono`). Each token is emitted with `light-dark(…, …)`, so one declaration carries both modes and the colour-mode toggle flips the whole UI by switching `data-skin-mode`. The swatches above are real tokens — flip the theme and watch the contract repaint.

Why it matters

A fixed contract is what makes skins swappable and components portable. Because every skin fills the same slots, you can re-theme by swapping one `tokens.css`, support light/dark as two value sets of one contract, and theme multi-tenant by a (tenant, domain, locale) lookup — without touching a single component. Components never learn the brand; they only speak `--ui-*`.