Skip to content
Changelog
new toolcss

clamp() Generator

v1.0

The clamp() Generator is the first tool in the CSS & Visual Builders section. Give it a size range and a viewport range (16px at 320px wide and 24px at 1280px, say) and it returns a complete clamp() value that stays flat below the minimum viewport, scales smoothly in between and stays flat above the maximum.

You can type and read sizes in px or rem, and a root font-size field (16 by default) controls the conversion. Three viewport presets (320 to 1280, 360 to 1440, 480 to 1920) cover common ranges. A property picker (font-size, padding and its logical variants, margin, gap, width, max-width, border-radius) sets the declaration in the output, and a "Value only" copy gives you just the clamp() expression. A Viewport/Container toggle switches the value between vw and cqi, and the wording changes to "container" to match. If the max viewport isn't larger than the min, the fields flag it and the output says so instead of showing something wrong.

An interactive graph shows size against viewport width, with both breakpoints marked. Drag the breakpoints, or move the scrubber, with the pointer or the keyboard (arrow keys, Home/End, Shift for bigger steps). A small flag shows the exact value as you move. A specimen box with editable text resizes live as you scrub, and a readout shows the viewport and size at that point. The curve animates when you change an input, unless your system asks for reduced motion.

Small help icons explain the less obvious controls, on click or Enter as well as hover. Your settings are remembered on this device, and Share puts the whole state in a link. Nothing is sent anywhere.

All changes