Density, type, and roundness
GHO-66 recipes on top of the token catalog. Components consume semantic --ghost-* variables. There are no per-component tokens.
Unset data-ghost-density is comfortable. data-ghost-density nests on any subtree the same way data-ghost-mode does: a descendant attribute overrides the ancestor. --ghost-roundness (0–1, default 1) is a CSS custom property on any subtree; every radius token is calc(<designed> * var(--ghost-roundness, 1)).
Spacing
The primitive scale is 4px (0, 1 = 4px, 2 = 8px, through 16 = 64px), with half-steps 0_5 (2px), 1_5 (6px), and 2_5 (10px) for control padding. Semantic roles are space.gap.*, space.inset.*, and space.stack.*. Density remaps those roles one step down (compact) or up (spacious). Compact space.gap.xs is 0, so spacing roles never size paint. Painted geometry uses track.thickness.* (4 / 6 / 8px), track.thumb.* (12 / 16 / 20px), and track.target (24px minimum hit size), which stay fixed at every density and theme. GhostProgress and GhostSlider read these.
Control heights
Heights are the five-step Precision SaaS scale 28 / 32 / 36 / 40 / 44px. Size and density map onto that scale:
| Size | compact | comfortable (default) | spacious |
|---|---|---|---|
| sm | 28px | 32px | 36px |
| md | 32px | 36px | 40px |
| lg | 36px | 40px | 44px |
Control padding and font size step alongside height:
| Size | compact (font / padding) | comfortable (font / padding) | spacious (font / padding) |
|---|---|---|---|
| sm | 12px / 2px × 8px | 13px / 4px × 10px | 13px / 6px × 12px |
| md | 13px / 4px × 10px | 14px / 6px × 12px | 15px / 8px × 16px |
| lg | 14px / 6px × 12px | 15px / 8px × 16px | 16px / 10px × 20px |
Themed controls that sit in a row with other controls read this scale instead of carrying their own padding, so a toolbar lines up without overrides. GhostButton, GhostInput, GhostSelect, GhostCombobox, the GhostDatePicker inputs and trigger, GhostTabs triggers, the GhostFileUpload trigger, and the GhostSegmentedControl and GhostToggleGroup tracks are one md control tall by default. Denser parts use the sm step: menu and listbox items, GhostMenubar triggers, GhostScrollSpy links, and GhostCalendar days and month buttons.
@media (pointer: coarse) floors every control minimum to 44px (control.touch, 2.75rem) so touch targets do not shrink with compact, comfortable, or small sizes. Fine pointers keep the mapped height.
Radius follows the same density step (4px / 6px / 8px for action.radius and radius.md), then multiplied by --ghost-roundness.
Type
UI sizes (type.size.xs–lg: 12 / 13 / 14 / 15px) resolve to crisp deterministic rem values; display heading sizes (type.size.xl–3xl) use fluid clamp() from 320px–1280px viewports. The stack is system UI only (ui-sans-serif, system-ui, sans-serif plus emoji fallbacks). No web font.
| Token | CSS | Use |
|---|---|---|
type.family.sans | --ghost-type-family-sans | System sans |
type.family.mono | --ghost-type-family-mono | System monospace (code) |
type.size.xs–lg | --ghost-type-size-* | Crisp UI rem scale (12–15) |
type.size.xl–3xl | --ghost-type-size-* | Fluid display scale |
type.letter.tight | --ghost-type-letter-tight | -0.02em |
type.letter.normal | --ghost-type-letter-normal | 0em |
type.letter.wide | --ghost-type-letter-wide | 0.04em |
type.numeric.tabular | --ghost-type-numeric-tabular | font-variant-numeric |
type.feature.default | --ghost-type-feature-default | kern / liga / calt |
type.feature.tabular | --ghost-type-feature-tabular | tnum plus kerning |
.price {
font-variant-numeric: var(--ghost-type-numeric-tabular);
font-feature-settings: var(--ghost-type-feature-tabular);
}Prose type.size.* tokens do not change with density, while interactive controls (GhostButton, GhostInput, GhostSelect, and peers) scale label size with density through control.size.*.font (medium weight 500 on action.label.weight).
Roundness
.product-theme {
--ghost-roundness: 0.35;
}
.chip {
border-radius: var(--ghost-radius-pill);
}--ghost-roundness | Effect |
|---|---|
0 | Sharp. Every radius token computes to 0. |
1 (default) | Designed radii. radius.pill is a capsule. |
| between | Linear scale of each token’s designed value. |
Set the knob on any subtree. Radius calc() is redeclared on descendants so a nested --ghost-roundness re-evaluates, matching --ghost-motion-intensity.
Live demo
Density and roundness on this card. Nested data-ghost-density inside a comfortable page still wins.
xsBody uses crisp type.size.md.12,345.00
Playground
The playground Density, type, and roundness section has the same controls plus a matrix of every density × roundness 0 / 0.5 / 1 used by browser snapshots.