Skip to main content

The type scale

The two type scales under the named steps, where line heights come from, and how each density maps onto them.

Version: EDS 2.0 (beta)

This page explains why the named steps in Overview are the sizes they are, using the primitive scales underneath them. You do not use those scales directly, and they are hidden from the Figma variable picker.

The steps in each density​

Each row is set with the tokens it names, and the size and line height beside it are read back from the browser. Switch the density to see every step move while the names stay put.

Header

typography.header.xs 
Well integrity review
typography.header.sm 
Well integrity review
typography.header.md 
Well integrity review
typography.header.lg 
Well integrity review
typography.header.xl 
Well integrity review
typography.header.2xl 
Well integrity review
typography.header.3xl 
Well integrity review
typography.header.4xl 
Well integrity review

Label

typography.label.xs 
Pipeline pressure
typography.label.sm 
Pipeline pressure
typography.label.md 
Pipeline pressure
typography.label.lg 
Pipeline pressure
typography.label.xl 
Pipeline pressure
typography.label.2xl 
Pipeline pressure
typography.label.3xl 
Pipeline pressure
typography.label.4xl 
Pipeline pressure
typography.label.5xl 
Pipeline pressure

Body

typography.body.sm 
The north manifold is due for inspection. Two valves showed wear at the last visit, so they are first on the list.
typography.body.md 
The north manifold is due for inspection. Two valves showed wear at the last visit, so they are first on the list.
typography.body.lg 
The north manifold is due for inspection. Two valves showed wear at the last visit, so they are first on the list.
typography.body.xl 
The north manifold is due for inspection. Two valves showed wear at the last visit, so they are first on the list.
typography.body.2xl 
The north manifold is due for inspection. Two valves showed wear at the last visit, so they are first on the list.
typography.body.3xl 
The north manifold is due for inspection. Two valves showed wear at the last visit, so they are first on the list.

The Equinor and Inter scales​

Each typeface has its own type scale, indexed in hundreds. The table lists the steps the named steps use:

Indexinterequinor
1009px10px
20010px12px
30012px14px
40014px16px
50016px18px
60018px21px
70021px24px
80024px28px
90028px32px
100032px36px
110037px–

Of the 10 Equinor steps in use, 9 are the same size as the Inter step one index up. The exception is 1000, where Equinor is 36px and Inter 1100 is 37px.

That offset is why a header is larger than the label with the same step name. It is part of the scale itself rather than a multiplier applied on top, so every size is a whole pixel. The scale in the earlier beta was calculated, and several of its steps fell between pixels.

Line height comes from spacing​

Each line height is a step on a line-height scale, and each step on that scale is an alias of a spacing primitive:

typography.label.md.line-height what you use
→ density.typography.label.md.line-height a different step per density
→ primitives.lineheight-scale.400.default
→ primitives.spacing.125
Line-height stepSpacing primitivepx
100spacing.7512px
200spacing.10016px
400spacing.12520px
500spacing.15024px
700spacing.17528px
800spacing.20032px
1000spacing.22536px
1100spacing.25040px
1200spacing.27544px

So every line height is a multiple of 4px, and text sits on the same rhythm as the layout around it: a line box and a gap of the same size are the same value. It also makes line heights absolute px rather than unitless ratios, which is why neighbouring sizes can share a line box.

How density works​

Each density picks different positions on the same scales, so every value stays on a whole pixel and every line height on the 4px grid. The token reference has the values for every step in all three densities, and they follow one rule: Compact uses the font size and line height of the next smaller step, and Relaxed the next larger. At the ends of a role's range, the pair comes from the primitive steps just beyond it.

The rule has one exception: Compact label.sm is 10/12, where Comfortable label.xs is 10/16.

Because density moves whole pairs, a font size mostly keeps its line height wherever it appears.

In header and body, a font size has the same line height in every density. In label, 10px has two: 12px and 16px.

Line height per role​

Line height divided by font size, at Comfortable:

Stepheaderlabelbody
xs1.331.60–
sm1.431.331.67
md1.251.431.71
lg1.331.501.75
xl1.331.331.56
2xl1.331.331.52
3xl1.291.331.50
4xl1.251.14–
5xl–1.13–

Header line heights​

Equinor is larger than Inter at the same step, and without trimming, a line box that is too short for the glyphs cuts off Equinor's descenders. So header line heights are chosen for Equinor rather than following the font-size step.

In 5 of the 8 header steps, the line-height step is above the font-size step:

StepFont sizeType-scale stepLine heightLine-height step
header.xs12px20016px200
header.sm14px30020px400
header.md16px40020px400
header.lg18px50024px500
header.xl21px60028px700
header.2xl24px70032px800
header.3xl28px80036px1000
header.4xl32px90040px1100

Matching the step numbers instead would bring back the tight headers we had before.

header.sm and header.md share a line height on purpose. Line heights sit on a 4px grid, which leaves few choices at these sizes: header.sm needs that line height to have enough leading, and the next value up would make header.md looser than a heading should be.

Label line heights​

label is single-line text, so it can be tighter than running text, and it is tightest at the top of its range. Neighbouring label sizes sometimes share a line height, which keeps a row the same height when the text in it changes size.

Body line heights​

body repeats the label font sizes with more line height: at least one and a half times the font size at every step and every density, on the 4px grid. That keeps lines of running text easy to follow.

The one and a half is a readability choice. WCAG 2.1 success criterion 1.4.12 uses the same ratio for a different purpose: components must keep working when users set it themselves, as accessibility on the usage page describes.

Adding a step​

  • Check density first. If a size is missing, a different density may already give it to you.
  • A new step needs a value in all three densities, and the font sizes need to be one position apart on the type scale, or density stops moving one step at a time.
  • Line height comes from the spacing scale. A new step needs a line-height step that resolves to a spacing primitive. lineheight-scale.1200 was added this way, for the largest sizes in Relaxed.

Where to go next​