Fluid Type Scale Calculator
Generate font size variables for a fluid type scale with CSS clamp. Grab the output CSS and drop it into any design system.
About this tool
Design systems traditionally used static type scales, where the steps in the scale are not dependent on the viewport or container width. This means that developers have to write media queries to switch font sizes at mobile, tablet, and desktop breakpoints. But in practice, there are innumerable device widths and orientations, so there are always going to be edge cases where your font sizes are either too large or too small.
By contrast, in a fluid type scale, each step has a minimum, maximum, and variable (viewport-dependent)
font size. We can use CSS clamp
and viewport width (vw
) units to generate a set of font size variables that
scale linearly. This means you no longer need to worry about fine-tuning your typography for discrete device widths: Just pick your minima and maxima, and the font sizes will scale fluidly in between.
Learn more
- Creating a Fluid Type Scale with CSS Clamp by yours truly! A deep dive into the math behind this technique.
- Modern Fluid Typography Editor, a handy tool by Adrian Bece that allows you to visualize a CSS
clamp
declaration. - Type Scale - A Visual Calculator by Jeremy Church.
- Utopia Fluid Type Scale Calculator by James Gilyead and Trys Mudford.
- Consistent, Fluidly Scaling Type and Spacing by Andy Bell.