How to use it
Pick a base size and a ratio. Each step up multiplies the size by the ratio and each step down divides by it. The preview shows every step at its size, with pixels and rem.
The ratios carry their usual musical names: minor second 1.067, major second 1.125, minor third 1.2, major third 1.25, perfect fourth 1.333, augmented fourth 1.414, perfect fifth 1.5, and the golden ratio 1.618. Rem values divide by the root size, 16 pixels unless you change it.
Copy CSS gives custom properties in rem. Copy fluid CSS gives one clamp() per step that grows in a straight line from the small-screen base at the first viewport width to the full base at the second; the middle term is an intercept in rem plus a slope in vw. A large ratio grows fast, so headings get very large within a few steps. Avoid the golden ratio for a long scale on small screens. Try 1.2 for interfaces and keep 1.618 for a few display sizes. For a scale built only on phi, with spacing and column widths, use Golden Typography & Layout.
Try this
- Set the base to your body text size.
- Use fewer steps up with a large ratio.
- Check the fluid sizes at both viewport widths.
Questions
What is a modular type scale?
A set of font sizes where each size is the one below it times the same ratio.
Which ratio should I use?
Smaller ratios such as 1.125 to 1.25 suit dense interfaces. Larger ratios such as 1.5 or 1.618 suit editorial pages with few heading levels.
How does the fluid clamp() work?
Each size grows in a straight line from its small-screen value at the first viewport width to its full value at the second, and stays fixed outside that range.
Why rem and not px?
Rem follows the reader's browser font size, so text scales when they change that setting.
Where is the phi-only scale?
Golden Typography & Layout builds a phi scale with spacing and column widths.