Skip to main
Link
A graph showing font size and zoom effectiveness versus viewport width. The font size, calculated as calc(17px + 2.5vw), increases linearly with viewport width. The 500% zoom line, representing the maximum possible zoom, shows that zoom becomes less effective as viewport width increases, failing to provide a 200% font size increase beyond a viewport width of 2040px.

Responsive and Fluid Typography with Baseline CSS Features

As designers, it makes sense to think about what space is available in the browser, and adjust your typography accordingly. It’s also important to remember that different users will have different font-size needs – and the more a font size is responsive to the viewport, the less responsive it will be to user inputs.

See more at web.dev »

This post is part of a series on revisiting fluid typography:
  1. Relative Units & TypographyWith special guest Alan Stearns
  2. Reimagining Fluid TypographyAre we responding to the right inputs?
  3. Revisiting Fluid TypeWith special guest Richard Rutter
  4. Designing for User Font-size and ZoomUsing modern CSS units and math functions
  5. Visualizing Responsive TypographyWhat do all the numbers in our `clamp()` do?
  6. The Best CSS Unit Might Be a CombinationWe don't have to choose between `px` and `rem` for spacing
  7. Responsive and Fluid Typography with Baseline CSS Features

I spent much of 2025 on this blog digging into font-sizing and responsive/fluid typography, and it has changed the way I approach sizing text on the web. Feel free to read (and watch the videos) back through my process if you’re interested in the details – but this article on the web.dev blog provides a quick summary of my current approach.

I found that graphing various relationships helped me understand better how all the parts interact. I may do a follow-up post here exploring and explaining this chart in more detail:

The default settings show calc(16px + 2.5vw). You can adjust the values and add clamp() ranges to the graph on Desmos.

This is really two graphs overlaid, using the same horizontal axis (viewport width in pixels) but a different vertical axis. Near the bottom, in px units, the base and zoomed font-size at different viewport widths, and a line showing that font-size grows at a much steeper pace than 200% zoom. Above, in % units, we can see the effectiveness of various zoom values, and the zoom required to achieve a font-size.

Hopefully I got the math right, but let me know if I’ve missed something.

Posts about Typography

  1. A measuring tape with both imperial and metric, then a ruler with only metric, and another ruler with combined units
    Article post type

    The Best CSS Unit Might Be a Combination

    We don’t have to choose between px and rem for spacing

    There are many articles and established CSS best-practices that rely on determining the correct or best units to use. Now that comparison functions are well supported in CSS, we don’t have to choose.

    see all Article posts
  2. Miriam gesturing as she talks in a video thumbnail
    Article post type

    Visualizing Responsive Typography

    What do all the numbers in our clamp() do?

    There are multiple tools that can help create a fluid font-size calculation for CSS – generally expressed as a clamp() function combining em (or rem) with vw (or vi) units. But the results are difficult to understand at a glance, so I wanted to visualize what’s going on…

    see all Article posts
  3. Close-up of keys on an old Spanish typewriter, part of the space bar, a, s, d, z, x, and MAYÚSCULAS (capslock) with release above it
    Article post type

    Designing for User Font-size and Zoom

    Using modern CSS units and math functions

    When I tried setting my browser font-size preferences, I found it broke more sites than it improved, and I quickly moved back to the default. So what went wrong, and how can we fix it?

    see all Article posts