| name | design-tokens-in-css |
| description | Use when establishing brand tokens for code reuse. CSS custom properties = native tokens. No build step needed.
|
Design Tokens in CSS
Design tokens = brand values as CSS variables. Define once, reuse everywhere. Native CSS, no build process.
Token system structure
:root {
--cream: #fbf6ec;
--ink: #0d0807;
--accent: #e85d2c;
--font-display: 'Fraunces', serif;
--font-body: 'Inter Tight', sans-serif;
--size-base: 1rem;
--scale: 1.333;
--size-h1: calc(var(--size-base) * var(--scale) * var(--scale));
--base: 4px;
--spacing-1: calc(var(--base) * 2);
--spacing-2: calc(var(--base) * 4);
--spacing-3: calc(var(--base) * 8);
--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
--duration-fast: 150ms;
}
Naming convention
Use semantic names, not values:
--accent (semantic) ✓
--orange (value) ✗
--text-primary (semantic) ✓
--text-ink (value) ✗
Semantic names allow rebranding without touching every variable.
Theme switching
[data-theme='dark'] {
--cream: #0d0807;
--ink: #f0ebe1;
--accent: #e85d2c;
}
User preference stored in localStorage, applied via data-attribute on <html>.
Where this fits in the X3 empire
Token system across all CardPrepAI surfaces.