Foundations
Compact and detailed scales coexist as infix tokens. Unscoped aliases and utilities follow data-df-color-scale. Browse the palette, then read the usage guide below.
Toggle compact or detailed to change which steps are shown and which infix names appear in tooltips. Swatch fills use the live CSS variables.
Click any swatch to copy its hex. Token names use an infix density marker (for example --df-neutral-compact-500).
Every primitive color is a CSS custom property. The density is part of the name so compact and detailed never collide.
Name shape
Token naming
12345--df-neutral-detailed-500--df-neutral-compact-500--df-neutral-500 /* alias → active mode */--df-blue-detailed-300--df-blue-compact-300
Pick the path that matches how much control you need. You can mix them in one app.
Direct
Reference an infix token. The value never changes when the page mode flips.
Mode switch
Set data-df-color-scale on html (or a subtree). Unscoped aliases and utilities follow it.
Alias
Write --df-neutral-500 or bg-neutral-500. The host mode chooses detailed or compact for you.
Use when a surface must stay on one density, even if the rest of the app switches. Both palettes are always defined on :root.
Inline style
Direct infix CSS
12345678/* Always the detailed mid gray */background: var(--df-neutral-detailed-500);/* Always the compact mid gray (same stop name, snapped value) */background: var(--df-neutral-compact-500);/* Hue example */border-color: var(--df-blue-detailed-400);
React
Direct infix React
1234567<divstyle={{ backgroundColor: "var(--df-neutral-detailed-40)" }}/><svg><rect fill="var(--df-blue-compact-500)" /></svg>
One attribute chooses which density unscoped aliases resolve to. Default File UI apps usually set detailed on the document root.
Document root
HTML mode attribute
1234567<html data-df-color-scale="detailed"><!-- aliases → --df-*-detailed-* --></html><html data-df-color-scale="compact"><!-- aliases → --df-*-compact-* --></html>
Subtree preview
Subtree mode
1234567{/* Compare both densities side by side */}<div data-df-color-scale="compact"><Button className="bg-neutral-500" /></div><div data-df-color-scale="detailed"><Button className="bg-neutral-500" /></div>
Short names for day-to-day UI. They are defined as var() pointers into the active infix palette.
What the CSS does
Alias mapping
12345678:root,[data-df-color-scale="detailed"] {--df-neutral-500: var(--df-neutral-detailed-500);}[data-df-color-scale="compact"] {--df-neutral-500: var(--df-neutral-compact-500);}
Usage
Alias usage
123color: var(--df-neutral-900);background: var(--df-brand-50);outline-color: var(--df-blue-400);
Generated utilities resolve through unscoped aliases, so they follow data-df-color-scale. Prefer these for layout chrome.
Background, text, border
Utility examples
123456<div className="bg-neutral-50 text-neutral-900 border border-neutral-100">Panel</div>{/* Compat aliases map to the same DF neutrals */}<div className="bg-zinc-100 text-gray-900" />
Kit components and most app chrome speak in roles, not ramp steps. Semantics live in df-tokens.css and point at neutral (or brand) aliases.
Common roles
Semantic tokens
12345678910--background--foreground--primary / --primary-foreground--secondary / --secondary-foreground--muted / --muted-foreground--accent / --accent-foreground--destructive--border / --input / --ring--card / --popover--sidebar-*
In markup
Semantic utilities
123456<main className="bg-background text-foreground"><button className="bg-primary text-primary-foreground">Save</button><p className="text-muted-foreground">Supporting copy</p></main>
The same rules apply to every family in the palette browser above.
Short patterns you can paste into tools and product UI.
Tool canvas that follows the app mode
Alias canvas
1234<divclassName="min-h-0 flex-1"style={{ backgroundColor: "var(--df-neutral-40)" }}/>
Illustration locked to detailed
Detailed illustration
12<circle fill="var(--df-cyan-detailed-260)" /><path stroke="var(--df-neutral-detailed-900)" />
Export from Color Lab
Exported CSS shape
123456/* palette1 · compact */:root {--df-neutral-compact-0: #ffffff;--df-neutral-compact-50: #f5f5f5;/* …}
Need a custom seed scale? Open Color Lab to generate stops, check contrast, and export CSS or JSON with the matching infix density names.