CSS Clamp Generator
Generate responsive CSS clamp() values for type, spacing, and layout with real viewport ranges instead of hand-calculating the math.
The preview uses the pixel formula so you can see the fluid scaling immediately.
Generate responsive CSS clamp() values for type, spacing, and layout with real viewport ranges instead of hand-calculating the math.
The preview uses the pixel formula so you can see the fluid scaling immediately.
CSS Clamp Generator produces a fluid clamp() value from a minimum and maximum size and the viewport range they should scale across, so type and spacing grow smoothly instead of jumping at breakpoints.
clamp() takes three values: a minimum, a preferred, and a maximum. Below the minimum viewport the value stays fixed at the minimum, above the maximum it stays fixed at the maximum, and between them the preferred value scales linearly.
The preferred value has to be built from a rem offset plus a vw multiplier, which is the linear equation running through your two points. Getting that arithmetic right by hand is fiddly, which is the entire reason this tool exists.
Fluid heading type with the default values:
Result: 18px at phone width, growing smoothly to 42px at 1280px, then holding steady above that.