Setting a Fluid Type Scale with CSS clamp()
One line of CSS per heading, and no media queries in sight.
A type scale that grows with the viewport used to mean a stack of media queries. Today a single clamp() call does the same work with less code and smoother results.
Setting type in the browser is still typesetting. The measure, the leading and the rhythm of the page matter as much on a screen as they did in a chase.
From the Case to the Stylesheet
:root {
--step-0: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
--step-1: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem);
--step-2: clamp(1.6rem, 1.3rem + 1.4vw, 2.4rem);
}
h1 { font-size: var(--step-2); }
h2 { font-size: var(--step-1); }
p { font-size: var(--step-0); }The good news is that CSS now gives us most of the controls a compositor had, from ligatures to hanging punctuation, if we are willing to use them.
- Limit the measure with the ch unit.
- Use unitless line-height values.
- Load only the font weights the page actually uses.
Have a correction or a story of your own? Write to the desk at desk@example.com and we will add it to the next issue.

Lovely piece. The photographs alone are worth the subscription.
I had no idea. Now I want to go and see it for myself.
Well put. I could not have said it better.
We will pass this on to the author, who will be glad to hear it.
I appreciate that you mention the mistakes as well as the successes.
This brought back memories of my grandfather’s print shop. Thank you for writing it.
The part about paper grain finally made it click for me. Thank you.
Great write-up. Bookmarking for the next workshop I teach.
Good point, and one we hope to cover in a future issue.
We have a drawer of this exact wood type at our shop. I never knew where it came from until now.
I tried this at home last weekend and it went about as well as you would expect for a first attempt. Going again on Saturday.
Any recommendations for a first press for someone with a small apartment?