Foundations

Typography

A slab serif for headings paired with a humanist sans for reading, matching the coffee-and-olive palette. Defined once in tokens.json and used through .type-* classes.

Why we chose this

Two families, each with one job. Zilla Slab, a slab serif, gives headings the warm, crafted voice of the coffee-and-olive palette. Hanken Grotesk is plain and open, so long reading and UI labels stay clear. A third family would only compete with these two.

Use it for

  • Headings, hero and section titles: .type-display, .type-headline, .type-title
  • Paragraphs and descriptions: .type-body
  • Buttons, fields, tags and captions: .type-label, .type-body-small

Don't

  • Set a size or weight by hand. Pick a style by its role.
  • Use the slab for body text or UI labels.
  • Size text in px. Sizes are rem so people's browser settings still work.

Font families

Why

Fonts carry brand personality, so the pair is chosen once: a display face for headings and a sans face for reading and UI. Components never name a font. They use --font-display and --font-sans, and the theme decides what those mean.

Type scale

Seven styles. Sizes are in rem so they follow the visitor's browser font setting. Line height is unitless so it scales with the size.

Why

Only three heading sizes (Display, Headline, Title) keep pages calm. Large type gets tight leading (1.08 to 1.2). Reading text gets loose leading (1.5 to 1.8) because long lines need room to breathe.

Responsive behavior

The same styles serve desktop web, responsive web and mobile. There are no separate "mobile styles" and no breakpoints for type. The three large styles are fluid: they shrink smoothly between a mobile minimum and a desktop maximum. Body and smaller text stay the same size everywhere.

Why

Big headings are the only thing that breaks on a narrow screen: a 64px display line wraps to one word per line on a phone. Reading text is already comfortable at 14 to 17px, so shrinking it would only hurt legibility. One fluid rule per heading replaces a pile of media queries and has no jumps at breakpoints.

How a fluid size is written

font-size: clamp(2.5rem, 5.4vw, 4rem);
            /* min     fluid   max */

The browser takes the middle value (a share of the screen width) but never goes below the minimum or above the maximum. The minimum and maximum are in rem, so they still respect the user's browser font-size setting. Never use vw alone: users could not zoom the text.

Mobile vs web

Try it: drag the screen width

Side by side

Mobile · 375px

Desktop · 1280px

Rules for mobile

RuleReason
Body is never smaller than 16px; the 14px body-small is for captions only.Readable at arm's length. On iOS, form text under 16px makes the browser zoom in when a field is focused.
Keep display to 2 or 3 lines on a phone. Shorten the copy before shrinking the type.At 40px a phone fits about 9 characters per line.
Reading lines of roughly 35 to 45 characters on mobile, 65 to 75 on desktop.Narrow screens do this naturally. Only cap the width with max-width: 65ch on desktop.
Tap targets are at least 44px tall, whatever the text size (token hit-target-floor).Small text in a link still needs a big touch area. Pad it, don't enlarge it.
Size in rem, never px, on the web.Users who raise their default font size get larger text.
Test at 320px wide and at 200% zoom.The two cases most likely to break wrapping.

Responsive web example

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="dist/tokens.css">
<link rel="stylesheet" href="dist/typography.css">

<h1 class="type-display">Systems built with care</h1>   <!-- 40px phone, 64px desktop -->
<p class="type-body" style="max-width:65ch">...</p>      <!-- 17px everywhere -->

Native mobile apps

If this system is later used in iOS or Android, take the mobile value as the base size and map it like this. This is guidance, not generated yet.

PlatformUnitScaling with user settings
iOS1rem = 16ptUse Dynamic Type so text follows the user's size setting.
Android1rem = 16spsp units follow the system font scale automatically.
React Native / Flutter1rem = 16 logical pxLeave font scaling on; don't lock text to a fixed size.
Do

Shorten the copy

Cut words so the heading fits in 2 lines at 375px.

h1 {
  font-size: clamp(2.5rem, 5.4vw, 4rem);
}
Don't

Shrink everything with vw

font-size: 5vw can't be zoomed and gets unreadably small on phones.

h1 {
  font-size: 5vw;
}

Naming

PatternExampleMeaning
type-<role>type-titleFamily, size and weight are part of the style.

Using it

CSS

<link rel="stylesheet" href="dist/typography.css">
<h1 class="type-display">Hello</h1>
<p class="type-body">Walk at 3pm</p>

Rules

RuleReason
Pick a style, never set size or weight by hand.One edit in tokens.json then updates every screen.
Choose by role (title, body), not by how big it looks.Roles keep hierarchy meaningful when sizes change.
Keep one H1 per page and don't skip levels.Headings are also the outline for screen readers.
Keep reading lines to about 45 to 75 characters (max-width: 65ch).Longer lines are tiring to read.
Don't go below 14px (body-small) for text people need to read.Smaller text is hard to read on phones.
Do

Use a style class

Apply type-title for section titles.

<h1 class="type-display">Camel</h1>
<h2 class="type-title">Our work</h2>
<p class="type-body">Walk at 3pm.</p>
<button class="cm-btn cm-btn--primary">
  <span class="cm-btn__label type-label">Book</span>
</button>
Don't

Hard-code the values

Writing font: 600 30px Georgia drifts away from the system.

<h1 style="font: 600 64px Georgia">Camel</h1>
<h2 style="font-size: 30px">Our work</h2>
<p style="font-size: 17px; line-height: 1.8">
  Walk at 3pm.
</p>