agentleFS
thrillmadethrillmade/agent-skills/skills/type-scale/SKILL.md

type-scale

Skill3 starsChanged 7 days agoMITView on GitHub

Use when designing, auditing, or extending a typography size scale built on a modular ratio. Names the canonical preset ratios (1.067 minor second → 1.618 golden), the picking heuristic by context (UI vs editorial vs marketing), the stops-up / stops-down convention (−2 to +8 default), the rounding rule (round to nearest integer px, rem derived after), and the upper-bound on ratios for product UI. Cite when an agent proposes a ratio above 1.5 for a product system or hand-picks scale steps outside a modular ratio.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If two adjacent steps would round to the same px, bump the larger one up by 1 px to preserve monotonic spacing.

    line 73
  2. Distinctive:

    After picking a ratio and emitting the scale:

    line 80
  3. Distinctive:

    Monotonicity: every step is strictly larger than the previous.

    line 82
  4. Distinctive:

    Upper-bound sanity: if the +5 step is unusable for headings in your system, the ratio is too aggressive.

    line 85

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Type scale

A modular type scale derives every font size from a single ratio applied to a base size. The discipline is choosing the ratio for the system's typical surface — UI density, editorial reading, marketing impact — then committing to it across the whole scale rather than per-role.

When to use

  • Designing a new typography scale from a base font size and a context (product UI / editorial / marketing).
  • Auditing an existing scale where sizes feel off-rhythm or step gaps look inconsistent.
  • Extending a scale up or down (e.g. adding a display rung above the existing max).
  • Code review: flag hand-picked sizes outside a modular ratio, ratios above 1.5 in product systems, or rems-as-source-of-truth (always derive rem from rounded px, not the other way around).

When NOT to use

  • Editorial-only books / long-form prose where the ratio is a typographer's pick and a modular scale would over-constrain. The discipline still applies to documenting the choices, not to forcing a ratio.
  • Single-size systems (rare; usually a stopgap during initial system definition).

Canonical preset ratios

RatioNameBest for
1.067Minor secondVery dense UI; gaps so small that most stops feel near-identical
1.125Major secondDense UI (admin consoles, data-heavy tools); subtle hierarchy
1.200Minor thirdA common default for product UI — balanced, readable, distinct headings
1.250Major thirdSlightly more dramatic UI; comfortable for mixed product + marketing
1.333Perfect fourthEditorial leaning; large gap between body and H1
1.414Augmented fourthEditorial; sharp hierarchy
1.500Perfect fifthMarketing-leaning; aggressive but still usable
1.618GoldenHero / display only; ratios above ~1.5 break down for product UI because step gaps grow too fast

Upper bound: ratios above 1.5 rarely work for product UI — by step +5 the size is huge, and H4/H5 stop feeling distinct from body. Reserve 1.5 / 1.618 for editorial or marketing systems.

Stops-up / stops-down

A common default range is step −2 to step +8. Step 0 is the base size.

size(n) = round(base × ratio^n)
rem(n)  = size(n) / 16

Typical role mapping for a 16 px base, 1.200 ratio:

SteppxremTypical role
−2110.6875Micro, legal, fine print
−1130.8125Small UI, metadata
0161.0000Body, base
+1191.1875Lead paragraph, H5
+2231.4375H4
+3281.7500H3
+4332.0625H2
+5402.5000H1
+6483.0000Display
+7573.5625Hero
+8694.3125Marketing splash

The range is generous so a single scale spans dense UI through marketing without per-surface forking.

Rounding rules

Round font sizes to integer px by default:

  1. Compute the raw size: base × ratio^n.
  2. Round to the nearest integer px. Sub-pixel sizes render inconsistently across browsers and OS hinting.
  3. If two adjacent steps would round to the same px, bump the larger one up by 1 px to preserve monotonic spacing.
  4. Derive rem from the rounded px, not from the raw value. rem = rounded_px / 16. The other direction (round the rem) compounds with the px round and produces drift.

Rounding can be disabled for math-pure systems where fractional sizes are tolerated downstream. Document the choice if you turn it off.

Verification

After picking a ratio and emitting the scale:

  1. Monotonicity: every step is strictly larger than the previous; no two adjacent steps share a px value after rounding.
  2. Round-trip: rem(n) × 16 = px(n) exactly (no drift from re-rounding).
  3. Distinguishability at small sizes: −1 and −2 are visually distinct (a ratio + base combo where they round to the same px is broken; pick a tighter ratio or larger base).
  4. Upper-bound sanity: if the +5 step is unusable for headings in your system, the ratio is too aggressive; drop to a tighter preset.

Cross-references

  • Routed here by: designing-a-design-system — the L1 dispatcher for building or extending a system.
  • REQUIRED BACKGROUND: line-height-grid — every size in the scale needs a line-height; the lh-ui (× 1.20) / lh-prose (× 1.50) tracks pair with this scale.
  • For role assignment after picking sizes: the typography-styles spec (compound tokens combining size + lh + tracking + weight + paragraph margin).
  • For the base size choice: 16 px is the common base; smaller bases (14 px) are valid for dense product UI but require revisiting line-heights and tap targets.

Sources

  • Modular Scale by Tim Brown — interactive picker for the canonical ratios.
  • Type Scale — same idea with live preview.
  • One worked instantiation: the UDTS typography foundations (its L2 skills are incubating in thrillmade/tokenomics).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.