One line of CSS replaced six media queries. That line is clamp(), and it’s the quiet revolution in responsive type. If you’re still stacking font-size rules per breakpoint, this post is for you.
The clamp formula
font-size: clamp(min, preferred, max);— where “preferred” is viewport-relative (vw) and min/max clamp the bounds. One declaration scales your type fluidly between mobile and desktop without a single media query.
Modular scales, not arbitrary sizes
Pick a ratio (1.25 for tight, 1.333 for balanced, 1.5 for dramatic). Build your scale from a base size upward and downward. You end up with 6–8 type sizes that share a rhythm. Arbitrary sizes feel off even when the reader can’t say why.
Line-height and measure
Fluid font size is half the problem. Line-height scales with size — tighter on display text, looser on body. Measure (line length) should stay around 60–75 characters. Cap containers with max-width: 65ch for body text.
Responsive typography is baseline craft in every product we ship under Logicore.