Design
Two ratios, one color seed, three type roles — the mathematics of beauty by default.
The norm of proportion and color. Nothing on a Standard page is an
eyeballed value: every size, space, and color derives from a small set of
constants. This is what makes beauty a default instead of a decision.
The living specimen of this book is the
landing page of this site — every specification it prints is measured
from the running stylesheet.
Sections
| § | Detail |
|---|---|
| Color System | The OKLCH engine, the pigment spectrum, accent strategies, elevation |
| Typography & Typefaces | Font stacks, the modular scale, rhythm, OpenType features |
| Responsive & Mobile Architecture | Harmonic optical compression, mobile rhythm, and touch ergonomics |
| Design Temperaments | The visual presets and what each enforces |
The 7 Golden Tokens (Foundational Levers)
Standard is not styled by writing thousands of procedural CSS rules or overriding 200 individual variables. Instead, it is an optical and mathematical engine driven by 7 Golden Tokens. Changing just these few declarative values reshapes the entire personality, spatial cadence, responsive scaling, and color hierarchy of an application.
flowchart TD
subgraph Seeds["THE 7 GOLDEN TOKENS"]
T1["--ratio<br><i>Harmonic scale factor</i>"]
T2["--density<br><i>Vertical rhythm & line-height</i>"]
T3["--font-text-size<br><i>Root base size anchor</i>"]
T4["--reading-width<br><i>Reading column measure</i>"]
T5["--page-padding<br><i>Canvas boundaries & mobile gutters</i>"]
T6["--radius<br><i>Geometric shape curvature</i>"]
T7["--color-light-background & foreground<br><i>Two OKLCH chromatic seeds</i>"]
end
subgraph Cascades["MATHEMATICAL CASCADE"]
C1["Modular Type Ladder<br>pow(ratio, n) -> --scale-d5 .. --scale-8"]
C2["Rhythm & Spatial Scale<br>1rlh -> --space -> --space-d12 .. --space-12"]
C3["Layout Grid & Breakouts<br>--prose-width, --prose-wide, --prose-full"]
C4["Shape & Controls<br>--radius, .rounded-*, buttons, inputs"]
C5["Relative Color Palette<br>5-step surface ladder, borders, auto dark mode"]
end
T1 --> C1
T2 --> C2
T3 --> C1
T4 --> C3
T5 --> C3
T6 --> C4
T7 --> C5
| Golden Token | Seed Role | Value Example | Systemic Cascade Effect |
|---|---|---|---|
--ratio |
Harmonic scale | 1.414 (Silver), 1.25 (Third), 1.618 (Golden) |
Sets --optical-ratio. Governs every step of the typography ladder (--scale-d5 to --scale-8) via geometric exponentiation. On mobile, switches to --ratio-mobile (1.272) for graceful scale compression. |
--density |
Spatial cadence | 1.35 (Swiss/dense), 1.5 (balanced), 1.65 (editorial) |
Sets fluid line height (--line-height), which locks root line height (1rlh) as the official rhythm unit (--baseline). This drives base --space and all 24 spacing tokens (--space-d1 through --space-12), altering every margin, gap, and padding across the UI simultaneously. |
--font-text-size |
Root measure | 1rem (16px), 1.125rem (18px) |
Drives --base-size and root typography scaling. Combined with --physics-slope, drives ultra-wide screen fluid growth. |
--reading-width |
Reading column | 42rem (classic), 38rem (novel), 48rem (manual) |
Resolves to --prose-width. Dictates optimal reading column (60–75 characters) and anchors breakout tracks (--prose-wide, --prose-full, --prose-inset). |
--page-padding |
Canvas boundary | Desktop: clamp(1rem, 6vw, 4rem)Mobile: --page-padding-small (var(--space-d2)) |
Keeps content safely contained from viewport edges and mobile bezels while maintaining harmonic alignment with the baseline rhythm. |
--radius |
Geometric curvature | 0px (Brutalist), 4px (Clean), 16px (Organic) |
Directly anchors --radius. Macro containers, cards, dialogs, buttons, and inputs inherit their curvature from this single anchor. |
--color-light-background--color-light-foreground |
Chromatic DNA | Paper #faf8f2Ink #221f1cAccent #c83e2b |
From two OKLCH seed colors, @stnd/styles derives the 5-step surface ladder (sunken, background, surface, raised, overlay), border hairlines, shadows, and automatic dark mode inversion. |
Proportion
- Golden ratio (1.618) governs layout blocks.
- Silver ratio (1.414) governs the typographic scale and line heights.
- One base size; the whole scale follows (
--scale-d5…--scale-8).
Color — the OKLCH engine
You choose an ink, a paper, and one accent. The engine derives
everything else at equal perceived lightness: surfaces and borders from your
paper, semantic states by rotating your ink’s hue (+25° error, +85° warning,
+145° success). Configure a dark theme and the light theme is its
deterministic inversion — background ↔ foreground, accent preserved.
Type roles
Three roles, not three fonts you pick per page:
| Role | Voice | Used for |
|---|---|---|
text |
the reading voice | continuous prose |
interface |
uppercase, spaced | navigation, labels, technique |
mono |
aligned, tabular | data, code, measurements |
Layout width
Two width tokens form the layout hierarchy: --page-max-width caps the container ceiling,
while --prose-width defines the optimal reading measure.
| Layer | Element | Token | Default | Controls |
|---|---|---|---|---|
| Page shell | body, .container |
--page-max-width |
1400px |
Maximum boundary for header, footer, content, and the ceiling .full grows into |
| Reading column | p, h1–h6, li… |
--prose-width |
42rem (672px) |
One line of readable prose (60–75 characters), everywhere — even outside .prose |
| Page gutters | body, .container |
--page-padding |
clamp(1rem, 6vw, 4rem) |
Fluid outer padding on desktop; drops to --page-padding-small (var(--space-d2)) on mobile |
.prose is a CSS grid with named, mirrored tracks (full / wide / content).
.narrowinsets secondary content (callouts, blockquotes, code blocks) inward (--prose-inset)..wide(andtable) breaks out from the reading column by--prose-wide(--spaceeach side)..fullspans across all grid columns to the--page-max-widthpage shell..full-bleedbreaks out across the entire screen width (100vw).
body centers itself with margin-inline: auto; children inherit safe containment
unless designated .full-bleed.
To pin content to the left edge of the browser (say, a 300px column,
flush left): add .left to .prose — it zeroes margin-inline and drops
the grid’s mirrored gutters so the content track starts at the box’s own
edge — then set --page-max-width and --prose-width to the widths you
want. .left isn’t a frontmatter token yet; today it needs a class in
markup or garden-wide CSS on the profile note.
The Dual-Axis Layout Model: .prose (X-Axis) vs .rhythm (Y-Axis)
Standard cleanly separates the horizontal reading column from the vertical flow cadence into two independent, orthogonal layers that work together without collision:
| System Layer | Spatial Axis | CSS Token Drivers | Primary Concern |
|---|---|---|---|
.prose |
X-Axis (Inline / Horizontal) | --prose-width (--reading-width), --prose-wide, --prose-full, --prose-inset |
The reading measure (60–75 characters), track alignment, centered vs .left, and breakout widths (.wide, .full, .full-bleed). Leaves vertical spacing entirely to the rhythm engine. |
.rhythm |
Y-Axis (Block / Vertical) | --space (1rlh), --rhythm-block-scale, --space-2, --space-3 |
Vertical cadence and baseline grid alignment. Handles natural 1x text flow, block transition breathing room via --rhythm-block-scale, and autonomous heading elevation. |
When building an article, essay, or documentation page, combine both on your container:
<article class="prose rhythm">
<h1>The Architecture of Thought</h1>
<p>Standard paragraph spaced at 1x vertical rhythm.</p>
<!-- Transitions between simple text and heavy blocks take --rhythm-block-scale (2x) -->
<table>...</table>
<p>Next paragraph smoothly continues on the 1rlh baseline.</p>
</article>
The Three Rules of Vertical Rhythm (.rhythm)
- Intimate Text Flow (
1x --space): Consecutive textual elements (p + p,ul + p,p + ol) share a single baseline unit (1rlh), maintaining smooth narrative momentum. - Context Transitions (
--rhythm-block-scale): Moving between standard text and visually heavy blocks (p + table,p + .stnd-code-block,p + blockquote,p + .card) automatically triggers an expanded breathing interval (calc(var(--space) * var(--rhythm-block-scale)), defaulting to2x).- Consecutive identical blocks (
code + code,table + table,img + img) stay unified (1xor--gap-grid-img) to avoid creating excessive empty canyons and preserve tight gallery layouts.
- Consecutive identical blocks (
- Autonomous Heading Elevation: Headings (
h1–h6) follow their own typographic hierarchy rooted in the baseline grid (--space-3for major section titles,--space-2for subheadings,--spacebetween grouped titles). They are deliberately disconnected from--rhythm-block-scale, so adjusting block breathing room never causes headings to drift out of proportion.
The override ladder
Framework defaults → theme (tokens.yaml) → per-note frontmatter tokens.
Later always wins; nothing else may set a design value. (The frontmatter
mechanism is specified in Standard::Vault — Frontmatter.)