Skip to content

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

RuleRequirementValid example
HeadingsSentence case on every heading level; capitalize only the first word and proper nouns.Modes and themes
SentencesEvery sentence states one verifiable fact or one enforceable rule.Body text stays at 16px across viewports.
Numeric unitsAttach the unit directly to the number with no intervening space.16px, 262ms, 90rem, 68ch
Excluded wordsVerified 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

Do: Write sentence-case headings and exact measurements
Write '## Modes and themes' and state 'Focus rings render a 2px outline with a 2px offset in var(--ring) on :focus-visible.'
Don't: Use title case, spaced units, or marketing filler
Do not write '## Modes And Themes', do not separate units as '16 px' or '262 ms', and never use the listed superlatives in documentation prose.

Accessibility

Token or utilityMeasured valueAccessibility purpose
--prose-max-width (max-w-prose)68chCaps line length for comfortable reading (WCAG 1.4.8 guidance)
--text-body16px (1rem)Fixed across 320px to 1920px viewports to prevent iOS input auto-zoom
--text-body--line-height24px (1.5rem)Snaps to the 4px vertical rhythm grid
tabular-numsfont-variant-numeric: tabular-numsAligns 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.