🔤Type Scale
Also known as Modular Scale, Typographic Scale
A set list of text sizes that grow by one ratio. Every heading uses one of them.
Think of it like
It is like the steps of a staircase. Each step goes up by the same amount.
Example
Jack uses a base of 16px and a ratio of 1.25. His sizes are 16, 20, 25, 31 and 39px, and nothing else.
Why it matters
A scale stops sizes like 15, 16 and 17 that are too close to tell apart.
Formula
size(n) = base × ratio^nDefinition
Example code
css
:root {
--text-base: 1rem; /* 16px */
--text-lg: 1.25rem; /* 20px */
--text-xl: 1.5625rem; /* 25px */
--text-2xl: 1.953rem; /* 31px */
}Common mistake
Key takeaways
- 1Base and ratio. 16px times 1.25, and so on.
- 2A fixed menu. Only sizes from the scale.
- 3Clear steps. Each size looks plainly different.