CSS clamp generator for fluid type

CSS clamp(min, preferred, max) lets a size grow with the viewport while staying between two limits, without media queries.

How to use the clamp generator

  1. Enter the smallest and largest sizes.
  2. Enter the viewport widths where scaling starts and ends.
  3. Copy the declaration.

How the preferred value works

It is a straight line through your two points, written as a rem offset plus a vw slope. Keeping a rem part means the size still responds to user font settings.

Frequently asked questions

Can I use it for spacing?

Yes. Replace font-size with padding, gap or margin.

Does fluid type affect accessibility?

It can. Keep the largest size within about 2.5 times the smallest and test browser zoom.

Is clamp() widely supported?

Yes, in all current major browsers.

Related tools