Design tokens
Font size
Published on
Set to the users preference or 18px, whichever is larger. 18px is chosen because of the increased thickness leading to improved contrast (WCAG ???). All headers use % of user setting, while ensuring a 2.5 ratio between the largest and smallest font sizes for readability.
Fluid Font size
Optional: Can be applied using <body class="fluid">.
| Device width | 360px | 480px | 768px | 1024px | 1280px | 1920px |
|---|---|---|---|---|---|---|
| Base | 17.80px | 18.40px | 19.84px | 21.12px | 22.40px | 25.60px |
| <h1> | 33.80px | 34.40px | 35.84px | 37.12px | 38.40px | 41.60px |
| <h2> | 29.80px | 30.40px | 31.84px | 33.12px | 34.40px | 37.60px |
| <h3> | 25.80px | 26.40px | 27.84px | 29.12px | 30.40px | 33.60px |
| <h4> | 21.80px | 22.40px | 23.84px | 25.12px | 26.40px | 29.60px |
| <h5> | 19.80px | 20.40px | 21.84px | 23.12px | 24.40px | 27.60px |
| <h6> | 18.80px | 19.40px | 20.84px | 22.12px | 23.40px | 26.60px |
| <small> | 14.60px | 15.20px | 16.64px | 17.92px | 19.20px | 22.40px |
| <h1>/<small> | x2.32 | x2.26 | x2.15 | x2.07 | x2.00 | x1.86 |
font-size - https://adrianroselli.com/2024/03/the-ultimate-ideal-bestest-base-font-size-that-everyone-is-keeping-a-secret-especially-chet.html max width - https://meyerweb.com/eric/thoughts/2018/06/28/what-is-the-css-ch-unit/
Example
References
- The Ultimate Ideal Bestest Base Font Size That Everyone Is Keeping a Secret, Especially Chet(opens in new tab) — Adrian Roselli
- Responsive Type and Zoom(opens in new tab) — Adrian Roselli
- What Is the CSS ch Unit?(opens in new tab) — Eric Meyer