Voice
Copy leads the interface: every heading uses sentence case, every sentence states a verifiable fact or an enforceable rule, and an automated test fails the build on the listed filler words.
Editorial rules
| Rule | Requirement | Valid example |
|---|---|---|
| Headings | Sentence case on every heading level; capitalize only the first word and proper nouns. | Modes and themes |
| Sentences | Every sentence states one verifiable fact or one enforceable rule. | Body text stays at 16px across viewports. |
| Numeric units | Attach the unit directly to the number with no intervening space. | 16px, 262ms, 90rem, 68ch |
| Excluded words | Verified by an automated Vitest scan across every MDX file outside inline and fenced code. | seamless, unleash, elevate, supercharge |
Headings capitalize only the first word and proper nouns, while body copy states one fact or rule per sentence with units attached directly to numbers. The Vitest suite (apps/docs/lib/voice.test.ts) scans every .mdx file under apps/docs/app and flags the listed marketing words outside inline and fenced code blocks.
Usage
Pair factual prose with the semantic typography and measure tokens:
<article className="max-w-prose">
<h1 className="font-display text-h1 font-semibold tracking-tight text-foreground">
Control sizing
</h1>
<p className="mt-4 font-sans text-body text-foreground">
Default medium controls render at 40px height with a 20px icon and an 8px
border radius.
</p>
<p className="mt-2 font-mono text-caption text-muted-foreground tabular-nums">
--control-height-md: 2.5rem (40px) · --duration-262: 262ms
</p>
</article>.docs-copy {
max-width: var(--prose-max-width);
font-family: var(--font-sans);
font-size: var(--text-body);
line-height: var(--text-body--line-height);
color: var(--foreground);
}
.docs-metric {
font-family: var(--font-mono);
font-variant-numeric: tabular-nums;
}Do and don't
Accessibility
| Token or utility | Measured value | Accessibility purpose |
|---|---|---|
| --prose-max-width (max-w-prose) | 68ch | Caps line length for comfortable reading (WCAG 1.4.8 guidance) |
| --text-body | 16px (1rem) | Fixed across 320px to 1920px viewports to prevent iOS input auto-zoom |
| --text-body--line-height | 24px (1.5rem) | Snaps to the 4px vertical rhythm grid |
| tabular-nums | font-variant-numeric: tabular-nums | Aligns digits vertically across table rows and token metrics |
Prose measure and body font sizing stay within readable bounds across all viewports, while tabular-nums aligns numerical columns for rapid scanning. Link text names the destination explicitly (Principles, Modes & themes) rather than using ambiguous labels (WCAG 2.4.4).
Rationale
Technical documentation succeeds when engineers and agents can extract constraints without filtering out promotional language. Treating voice rules as testable assertions keeps prose as strict and deterministic as the TypeScript token scales.