Appearance
Typography Tokens
Here is a subset of typography tokens, with two typography styles (Body and Heading), defined for two different breakpoints (Medium and Small).
Typography Tokens
Name
Value
Typography
Body
Medium
Font Size
12px Line Height
16pxTypography
Body
Small
Font Size
10px Line Height
14pxTypography
Heading
Medium
Font Size
36px Line Height
44pxTypography
Heading
Small
Font Size
24px Line Height
28pxWhilst design tools often provide ways of grouping together common font properties (family, weight, size and line height), you will still end up with number of styles × number of breakpoints definitions.
A much more compact and efficient representation is to use modes:
Breakpoint Tokens
Name
Medium
Small
Typography
Body
Font Size
12px10px Line Height
16px14pxTypography
Heading
Font Size
36px24px Line Height
44px28pxWARNING
You may well have other variables that respond to breakpoints, unrelated to typography. These would all need to go in the same collection, until such a time as design tools support common modes across different collections.
A note on units
The above example use px as a unit, which is of course incorrect. We should always respect the user's preferences; if they have set their browser to use a larger (or smaller) base font size, that must be reflected.
Our typography tokens should be expressed in rem, converted using a base fonr size of 16px:
Breakpoint Tokens
Name
Medium
Small
Typography
Body
Font Size
0.75rem0.625rem Line Height
4/31.4Typography
Heading
Font Size
2.25rem1.5rem Line Height
11/97/6Note the exact fractions used for line-height. Whilst the CSS specification states that values should be serialised to six decimal places, this will result in different behaviours between different browsers due to different rounding behaviour.
This is the first of many instances were design tooling cannot express accurately the desired implementation.