# Typography

Most of a design's hierarchy and personality comes from type. Get type right and a plain layout already looks designed.

## Choosing families

- **One family can be enough.** A family with a good range of weights (and a width axis, if it has one) can carry a whole product.
- **Two at most, usually.** Pair a display face with a text face, or a sans with a mono. Pair by contrast (serif display + sans text) or by shared structure (a sans and its matching mono). Never two similar sans-serifs.
- **Pick for the direction, not out of habit.** Inter is a fine workhorse for dense UI, but it shouldn't be the voice of every product.

A starting list by role (all on Google Fonts):

| Role                 | Options                                                                                            |
| -------------------- | -------------------------------------------------------------------------------------------------- |
| Text sans (UI, body) | Inter, Geist, Instrument Sans, Hanken Grotesk, Public Sans, Figtree, DM Sans, IBM Plex Sans, Onest |
| Display sans         | Inter Tight, Archivo, Bricolage Grotesque, Space Grotesk, Familjen Grotesk, Syne, Unbounded        |
| Display serif        | Fraunces, Instrument Serif, Newsreader, Playfair Display, DM Serif Display, Gloock, Young Serif    |
| Text serif           | Source Serif 4, Newsreader, Literata, Lora, EB Garamond                                            |
| Mono                 | JetBrains Mono, Geist Mono, IBM Plex Mono, DM Mono, Space Mono                                     |
| Condensed            | Oswald, Barlow Condensed, Bebas Neue, Anton                                                        |
| Rounded / friendly   | Nunito, Rubik, Baloo 2, Figtree                                                                    |

## The scale

Use 5 to 7 sizes from one ratio, rounded to whole pixels:

| Ratio       | Feel                       | Example sizes (px)          |
| ----------- | -------------------------- | --------------------------- |
| 1.2         | dense apps, data           | 12, 14, 16, 19, 23, 28      |
| 1.25        | general UI                 | 12, 14, 16, 20, 25, 31, 39  |
| 1.333       | marketing, content         | 14, 16, 21, 28, 38, 50, 67  |
| 1.5 or more | editorial, posters, heroes | 14, 16, 24, 36, 54, 81, 120 |

A product can use a tighter ratio inside the app and a wider one on its marketing pages. At display sizes, scale headlines with the viewport (`clamp(40px, 6vw, 88px)`) rather than jumping between breakpoints.

## Setting text

**Line height falls as size rises:**

| Size    | Line height |
| ------- | ----------- |
| 12–16px | 1.5–1.6     |
| 18–24px | 1.35–1.45   |
| 28–40px | 1.15–1.25   |
| 48px+   | 1.0–1.1     |

**Letter-spacing:**

- Display sizes (40px and up): tighten, about −0.02em to −0.04em.
- Body: leave it at 0.
- Uppercase (buttons, short UI text in some directions): always add tracking, +0.04em to +0.12em, and keep it small.
- Very small text (11–12px): a touch of extra tracking, +0.01em, helps.

**Line length:** 45 to 75 characters; aim for about 65 (`max-width: 65ch`) for body text. Wide text is the most common reason a page feels hard to read.

**Wrapping:** balance headlines (`text-wrap: balance`) so no line is left with one word; use `text-wrap: pretty` for body text to avoid orphans.

**Paragraph spacing:** about the body line height (e.g. 24px between paragraphs of 16/24 text). Don't indent and space at the same time.

## Weight and color

- Use two or three weights per family. For example: 400 for body, 500 for UI labels, 600 or 700 for headings.
- Large display text can go light (300) for elegance or black (800–900) for punch. Both look intentional. The 600 middle at 72px often looks indecisive.
- Use three text colors: primary (strong contrast), secondary (muted, still at least 4.5:1), tertiary (hints, placeholders, disabled). A lighter color makes text quieter more gracefully than a smaller size.
- Don't use bold for long passages, or italic for UI labels.

## Details that mark care

- **Figures**: tabular figures (`font-variant-numeric: tabular-nums`) in tables, prices, timers and stats so columns line up and numbers don't jitter.
- **Punctuation**: real quotes and apostrophes (“ ” ’), an en dash for ranges (9–5), an ellipsis character (…), the × sign for dimensions.
- **Non-breaking spaces** between numbers and units (10 GB, 24 px), and in short names that shouldn't split.
- **Uppercase** only for short labels and buttons in some directions, never for sentences or for eyebrows above headings.
- **Hanging punctuation**: in large pull quotes, let the opening quote mark hang outside the text edge so the letters align.
- **Mixed headlines**: one word in an italic or a contrasting family can carry a whole direction ("Design with _agents_"). Use it once per page.
- **Underlines** for links in body text: offset (`text-underline-offset: 0.2em`) and thinner (`text-decoration-thickness: 1px`) look intentional.

## Common type mistakes

- Too many sizes (more than 7) or sizes that differ by 1px.
- Headings that are bigger but not otherwise different from body text.
- Centered body text longer than two lines.
- All-caps headings with no tracking.
- Eyebrows: a small label above a heading that repeats it. Cut it, and make the heading clear enough to stand alone.
- Placeholder text used as labels.
- Light gray text that fails contrast because it "looks elegant".
