typography-system
Turn a style constraint into a full typographic system: pick a verified font
pairing, derive a modular scale, and emit DTCG $type: "typography" tokens
through the design-tokens toolchain.
A two-stage Method: stage 1 (below) is the style path — a mood/idiom
constraint drives the pairing. Stage 2 is the brand-aware path — when a
brand layer exists, the brand archetype filters the pairing first. The skill
degrades gracefully: with no brand layer, only stage 1 runs.
When to use
- Choosing heading/body fonts for a new product or rebrand.
- Building or overhauling a typographic scale (sizes, line-height, weights).
- Any request to "set the typography" or "pick fonts" for a design system.
- Before calling
design-tokensfor a new project — typography tokens belong
in tokens.json alongside color tokens, not hand-coded in CSS.
Procedure
- Take a style/idiom constraint from the
design-intelligenceidiom
corpus — a mood keyword (e.g. elegant, modern, playful) or a
named idiom that carries typographic intent.
- Query
font-pairings-reference.csv(Reference layer) — filter by the
Mood/Style Keywords column; surface the top 1–2 matching pairings with
their Heading Font, Body Font, Best For, and Google Fonts URL.
- Derive the type scale — pick a modular ratio (1.25 Minor Third or 1.333
Perfect Fourth for most products); compute sizes for `xs / sm / base / lg /
xl / 2xl / 3xl`; assign weights (400 body, 600–700 heading).
Body line-height authority: 1.5 for body text, within a 1.4–1.7 band
by measure and x-height; other carriers cite this, Q8 is the floor. Display
takes about 1.2. tabular-nums and opsz: worked scales.
- Emit DTCG
$type: "typography"tokens throughdesign-tokens
(scripts/tokens.ts) — add a typography section to tokens.json with
$type: "typography" and $value objects carrying fontFamily,
fontSize, fontWeight, lineHeight.
- Verify — confirm both chosen fonts exist on Google Fonts (check the
Google Fonts URL column in the CSV — this is an availability check,
"does this font exist?", and is deliberately separate from the delivery
decision, "how does it get onto the page?" — see § Delivery below; conflating
the two is what produced a single hard-wired hotlink); run
node <skills-root>/design-tokens/scripts/tokens.mjs validate --dir src/
to confirm no hardcoded font-size or font-family values remain outside the
token file; exit code 0 is the evidence.
Stage 2 — brand-aware path (when a brand layer exists)
When a brand archetype is known (a confirmed brand-strategy /
brand-identity constraint set, or a consumer brand profile), filter the
pairing by the archetype before the mood match — the brand constrains the
style, not the other way around.
- Resolve the archetype from the active brand layer (e.g.
Ruler,
Lover, Magician).
- Query the brand
typographyGrounding domain for the archetype →
pairing-filter (Heading Class, Body Class, Mood, plus confidence +
evidence gap):
```bash
node <skills-root>/corpus-grounding/scripts/ground.mjs search \
--manifest <skills-root>/brand/data/manifest.json \
"<archetype + sector>" --domain typography --json
```
- Filter
font-pairings-reference.csvby that pairing-filter — keep only
pairings whose Heading/Body classes satisfy the archetype filter (e.g. a
Ruler / law-firm brief keeps serif-containing pairings; a Magician /
SaaS brief keeps geometric-sans pairings). Then apply the stage-1 mood match
within the filtered set.
- Surface the corpus
confidence+evidence_gapfor the archetype row,
then emit DTCG type tokens exactly as stage 1 (steps 4–5 above).
- Trigger-eval invariant: a "law-firm redesign" brief MUST route to a
serif-containing pairing (the archetype filter is Ruler → serif). This is
the recorded brand-aware regression test (recorded in Phase D).
Consumer brand tokens outrank the corpus filter