Roosevelt Docs

Design Tokens

Core → Semantic token architectuur met CSS custom properties

Design Tokens

Het Roosevelt design system gebruikt een twee-laags token architectuur geïnspireerd door Adyen/Bento: Core tokens definiëren rauwe waarden, Semantic tokens geven ze een rol.

Architectuur

Core Layer          →  Semantic Layer        →  Tailwind Utility
─────────────────────────────────────────────────────────────────
#5F2104             →  --color-brand         →  text-brand
#0A0F1A             →  --color-label-primary →  text-label-primary
#ffffff             →  --color-bg-primary    →  bg-surface-primary
14px                →  --text-body-size      →  text-body
8px                 →  --space-4             →  (custom spacing)

Waarom semantic tokens?

Semantic tokens maken dark mode, theming en refactoring mogelijk zonder component-code aan te passen. Verander één token, en het hele systeem volgt.

Color Tokens

Brand

TokenLightDarkTailwind
--color-brand#5F2104#C4854Atext-brand / bg-brand

Label (Text)

TokenLightDarkTailwindRol
--color-label-primary#0A0F1A#edededtext-label-primaryHoofdtekst
--color-label-secondary#334155#a1a1a1text-label-secondarySubtekst
--color-label-tertiary#8d95a3#737373text-label-tertiaryPlaceholder, meta
--color-label-critical#DC2626#DC2626text-label-criticalErrors
--color-label-highlight#3B82F6#3B82F6text-label-highlightLinks, accenten
--color-label-on-color#ffffff#fffffftext-label-on-colorTekst op kleurvlak

Background (Surface)

TokenLightDarkTailwind
--color-bg-primary#ffffff#0a0a0abg-surface-primary
--color-bg-secondary#F8FAFC#171717bg-surface-secondary
--color-bg-accent#DBEAFEbg-surface-accent
--color-bg-dark#0A0F1A#000000bg-surface-dark
--color-bg-critical#DC2626bg-surface-critical
--color-bg-success#059669bg-surface-success
--color-bg-warning#D97706bg-surface-warning

Outline (Border)

TokenLightDarkTailwind
--color-outline-default#E2E8F0#2a2a2aborder-outline
--color-outline-strong#CBD5E1#404040border-outline-strong
--color-outline-active#0A0F1A#edededborder-outline-active

Typography Tokens

TokenWaardeTailwind
--text-caption-size12px / 18pxtext-caption
--text-body-size14px / 20pxtext-body
--text-subtitle-size16px / 26pxtext-subtitle
--text-title-size16px / 26pxtext-title
--text-title-l-size24px / 32pxtext-title-l
--text-display-size39px / 1.1text-display
--text-hero-size49px / 1.1text-hero

Spacing Tokens

Gebaseerd op een 2px grid (geen 7, 9 of 11 — bewust weggelaten).

TokenWaardeTokenWaarde
--space-00px--space-1020px
--space-12px--space-1224px
--space-24px--space-1632px
--space-36px--space-2040px
--space-48px--space-2448px
--space-510px--space-2856px
--space-612px--space-3264px
--space-816px

Radius Tokens

TokenWaardeGebruik
--radius-xs2pxBadges, tags
--radius-s4pxButtons, inputs
--radius-m8pxCards
--radius-l12pxModals, grote cards
--radius-xl24pxPills, volledig afgerond

Shadow Tokens

TokenWaardeGebruik
--shadow-low0px 2px 4px rgba(10,15,26,0.04), 0px 1px 2px rgba(10,15,26,0.02)Cards standaard
--shadow-md0 4px 6px rgba(10,15,26,0.07)Hover states
--shadow-lg0 10px 15px rgba(10,15,26,0.1)Modals, overlays

Motion Tokens

TokenWaardeGebruik
--transition-fast150ms easeHover, focus states
--transition-base250ms easeLayout changes, modals

Token Override Voorbeeld

/* globals.css — dark mode override via semantic layer */
@media (prefers-color-scheme: dark) {
  :root {
    --color-brand: #C4854A;
    --color-label-primary: #ededed;
    --color-bg-primary: #0a0a0a;
  }
}

On this page