Section padding (24px → 96px)
- Input
- min: 24px @ 320px viewport, max: 96px @ 1440px viewport
- Expected output
- --space-section: clamp(1.5rem, 5.45vw + 0.27rem, 6rem);
Token for vertical section padding. Scales proportionally.
fluid CSS spacing clamp padding gap
Fluid spacing with `clamp()` applies the same logic as fluid typography to layout properties: padding, margin, gap, row-gap, column-gap. The result is a layout that breathes proportionally at any screen size — from 320px to 2560px — without a single media query.
Token for vertical section padding. Scales proportionally.
Responsive gap for grids. Avoids visual compression on small screens.
It's a CSS function that constrains a value between a minimum and a maximum. In the middle it accepts any CSS expression — typically `viewport-width + rem-constant` for fluid typography.
Not directly in the same parameter. But the browser converts automatically before evaluating. `clamp(1rem, 2vw + 0.5rem, 3rem)` works perfectly — the browser uses px internally for comparison.
Yes. Dynamic viewport units (dvh, dvw) work inside clamp. They are especially useful for hero section heights that should vary between devices and browser states.
font-size: clamp(1rem, 0.7512vw + 0.8239rem, 1.5rem);1rem1.5rem0.7512vw0.8239remCSS is generated locally in your browser.