Tokens
One source of truth for colour, dimension, motion.
323 entries across primitive → semantic → component → theme. W3C Design Tokens Format. Every entry carries $value, $type, $description, role, and Figma binding with scopes[]. Click any swatch to copy the hex.
Primitive - brand & neutral
Indigo-600 is the brand. Stone is the neutral. Teal-600 is Iris (the AI / intelligence accent).
color.brand.indigocolor.neutral.stonecolor.palette.tealChart-domain ramps NEW · BRIEF-401
38 hex values landed in v1.4.0 - three sequential ramps (10 stops each) + two diverging extensions (4 stops each). OKLCH perceptually equal-stepped. Read the full rationale →
color.palette.riskcolor.palette.financialcolor.palette.operationalcolor.palette.diverging-warmcolor.palette.diverging-coolSemantic - what each role resolves to
Semantic tokens alias primitives. Components alias semantic tokens. Override-only theme files re-bind the semantic layer per mode.
Themes
3 runtime themes (light · dark · HC) plus a print stylesheet. The dark and HC themes are override-only: they re-bind keys at the semantic tier; unbound keys inherit light. The print stylesheet uses pure white surfaces, 80/60% black text tiers, and four pattern-fill assets per band.
Dark
~47 overrides. Surfaces L\* 0.18 (never #000); brand brightens to indigo-500-equivalent; risk bands lift-and-flip.
stableHigh contrast (forced-colors)
CSS system keywords (Canvas, CanvasText, Highlight…). Chart marks differentiate via shape, dash, pattern only - colour cannot carry meaning.
stablePure white surfaces. Seven-tier black ladder. Four pattern-fill SVG-data-URI tokens; pattern density tracks band severity inversely.
stableLight
The baseline. v4.1+ stable.
stableDimension & density
Base unit 4px. Spacing scale 0–48px. Three density modes: compact (0.75×) · default (1×) · comfortable (1.25×). Global data-density cascades.
Spacing
4 · 8 · 12 · 16 · 24 · 32 · 48 px
dimension.spacing.{1..8}Radius
4 · 8 · 12 · 16 · full
dimension.radius.{sm..full}Density
0.75× · 1× · 1.25× scalars
dimension.density.scale.{...}How to consume
Tokens emit to CSS custom properties via Style Dictionary. Consume them through Tailwind arbitrary values or vanilla CSS.
From Tailwind
// Component code - never reach past the role-token layer.
<button className="bg-[var(--color-action-primary)] text-[var(--color-text-on-action)] hover:bg-[var(--color-action-primary-hover)] rounded-[var(--dimension-radius-button-default)]">
Sign up
</button>From vanilla CSS
.my-button {
background: var(--color-action-primary);
color: var(--color-text-on-action);
}
.my-button:hover {
background: var(--color-action-primary-hover);
}
/* Themes auto-apply when data-theme is set on the root */
[data-theme="dark"] .my-button { /* values auto-inherit overrides */ }From the JSON tree
import tokens from '@risqbase-inc/ui-components/tokens';
console.log(tokens.color.action.primary);
// { $value: '#4F46E5', $type: 'color', $description: 'Primary action surface - CTAs, primary buttons', ... }Methodology
Every chart-domain hex was computed in OKLCH (Björn Ottosson, 2020) - the only perceptual space where equal L\* steps look equally far apart. Every AA pair was verified against WCAG 2.2 §1.4.3 / 1.4.11. Diverging extensions clear 7:1 vs surface.default.
See the BRIEF-401 changelog entry for full per-ramp rationale and rejected alternatives (≥2 per ramp).