RevealTheme logo

Generator CSS Clamp()

Hasilkan nilai CSS yang fluid dan responsif dengan clamp(). Skalakan dengan mulus antara ukuran minimum dan maksimum di sepanjang rentang viewport.

font-size: clamp(16px, 13.0909px + 0.9091vw, 24px);

Cara menggunakan alat ini

  1. 1

    Enter the minimum size in pixels (the value at and below your small viewport).

  2. 2

    Enter the maximum size in pixels (the value at and above your large viewport).

  3. 3

    Set the min and max viewport widths in pixels that define where scaling starts and stops.

  4. 4

    Read the generated clamp() declaration and click Copy to paste it into your stylesheet.

Apa itu Generator CSS Clamp()?

Fungsi CSS clamp(min, preferred, max) menjaga nilai tetap terbatas sekaligus memungkinkannya menskala secara mulus dalam rentang tersebut. Sempurna untuk tipografi responsif yang tumbuh dengan halus seiring lebar viewport alih-alih melompat pada breakpoint. Alat ini menghitung rumus nilai preferred yang tepat dari ukuran font minimum/maksimum dan lebar viewport Anda.

Kasus penggunaan umum

  • Building fluid headings that grow from 24px on mobile to 48px on desktop without writing media-query breakpoints.

  • Setting responsive body copy that stays readable between a 320px phone and a 1200px laptop.

  • Scaling section padding or gap values fluidly so layouts breathe proportionally across screen sizes.

  • Replacing a stack of font-size overrides at 480px, 768px, and 1024px with one clamp() declaration.

  • Generating clamp() values for a design system so spacing and type scale consistently from one formula.

  • Quickly checking the px and vw math for a fluid value you sketched out in a design tool like Figma.

Pertanyaan yang sering diajukan

Bagaimana kompatibilitas browser?
clamp() berfungsi di semua browser sejak 2020: sepenuhnya aman untuk digunakan dalam produksi.

Alat terkait