Use when defining, refactoring, or auditing a strict project typography system with mathematical ratios and canonical role rules, and when creating/updating repo-root TYPO.md.
Resources
2Install
npx skillscat add derklinke/codex-config/design-typography-system-doc Install via the SkillsCat registry.
SKILL.md
Typography System Doc
Create and maintain a strict, tokenized typography doctrine in <repo-root>/TYPO.md.
Mandatory Pairing
- Run with
design-quality-gatesfor pass/fail validation. - Run with
design-system-docwhen typography changes also affect broader design doctrine.
Output Artifacts
- Required:
<repo-root>/TYPO.md(canonical typography spec) - Optional: token map updates in code (
--type-*,--space-*, design tokens)
Role Set (Minimum)
Use exactly these baseline semantic roles unless product scope requires more:
h1(page/section primary heading)h2(section heading)h3(subsection heading)body(default reading text)caption(supporting/meta text)
Workflow (Required)
- Read current doctrine (
DESIGN.md, if present) and existing type usage. - Define the mathematical model:
B: body base sizeR_head: heading ratioR_text: body/caption ratioG: vertical rhythm grid
- Compute role sizes from ratios (no ad-hoc values).
- Quantize line-height and spacing to
G. - Define list/link/paragraph rules (below).
- Encode all rules in
<repo-root>/TYPO.mdusing template. - Validate with
design-quality-gatesbefore sign-off.
Mathematical Spec
Use explicit formulas in TYPO.md:
size(step) = B * R^steplineHeightPx = round((sizePx * k) / G) * GparagraphGapPx = n * G
Recommended starting ranges:
B:16px(web default baseline)R_head:1.2to1.333R_text:1.067to1.125G:4pxor5px(pick one; no mixed grids)
Typesetting Rules (Required)
- Semantics first: visual hierarchy must map to document structure.
- Measure: long-form body text targets
~45-75ch(up to~90chcontext-dependent). - Leading: running text typically
>=1.5for accessibility robustness. - Paragraph rhythm: fixed tokenized spacing; avoid one-off margins.
- Links: underlined by default in prose; visited state defined; remove underline only in clearly navigational context.
- Lists:
- Bulleted list for unordered items.
- Numbered list when order is meaningful.
- Optional spaced-list variant for multiline items.
- Glyph integrity: true quotes/apostrophes/dashes/ellipsis; no faux bold/italic/small caps; no stretched/compressed text.
- Justification caution: avoid full justification unless hyphenation + river/ladder control is verified.
Accessibility Invariants
Must explicitly pass:
- WCAG text spacing adaptability: no content/functionality loss at:
- line-height
1.5 - paragraph spacing
2xfont size - letter spacing
0.12em - word spacing
0.16em
- line-height
- Contrast rules for text and links (per project AA/AAA target).
- Reflow/zoom checks on core templates.
TYPO.md Contract
TYPO.md must include:
- Scope and intent
- Typeface stack policy
- Ratio model (
B,R_head,R_text,G) - Role table (
h1,h2,h3,body,caption) with size/line-height/weight/tracking - Paragraph rules (measure, spacing, alignment)
- List rules (bullet/number/spaced variant)
- Link rules (default/hover/visited/focus)
- Accessibility and QA gates
- Token mapping (web + platform mappings if applicable)
- Allowed exceptions and approval policy
Template: references/TYPO-template.md
Failure Conditions (Blockers)
- Missing canonical
TYPO.md. - Role values not derivable from declared ratios.
- Unscoped one-off font sizes/line-heights.
- Missing
h3definition. - Link/list behavior unspecified.
- WCAG spacing override breakage.
Related Skills
design-quality-gates- sign-off validation.design-system-doc- align typography doctrine withDESIGN.md.design-frontend- implementation once tokens/rules are fixed.
Sources
references/sources.md