Skip to main content

Fluid Typography

UI Design

What is Fluid Typography

Fluid typography is text that scales smoothly with the screen width. Instead of jumping between fixed sizes at breakpoints, a heading grows gradually from a minimum size on small screens to a maximum size on large ones.

How Fluid Typography works

  • Minimum size: The smallest the text can get
  • Preferred size: A value that grows with the viewport width
  • Maximum size: The largest the text can get

In CSS, the clamp() function combines all three. Tools such as Utopia calculate a full fluid type scale.

When to use Fluid Typography

Use fluid sizes for headings and display text, where the difference between phone and desktop sizes is large. Body text often works better with a fixed size or small steps. Fluid typography does not replace breakpoints; it fills the space between them.

Fluid Typography and accessibility

Use rem units for the minimum and maximum, and combine viewport units with rem in the preferred value. Pure viewport units or pixel limits can stop text from growing when users zoom.

Frequently asked questions

How do you create fluid typography in CSS?

Use the clamp() function with a minimum size, a preferred size based on the viewport width and a maximum size. Tools such as Utopia calculate the values for a whole type scale.

Is fluid typography accessible?

It can be if you use rem units for the minimum and maximum and mix vw with rem in the preferred value. Pure viewport units or pixel limits can stop text from growing when users zoom.

What is the difference between fluid and responsive typography?

Responsive typography changes font sizes in steps at breakpoints. Fluid typography changes them smoothly as the screen width changes, with no jumps between sizes.