← TechnologyThe essentials of

clamp(): smooth size with lower and upper bounds

Publisher: ResumeMaker • 1 source

Published: 22 Oct 2026 13:13 · Updated: 22 Oct 2026 13:13

AI source check: 21 Oct 2026 10:36. This is not editorial approval.

In a few sentences

In brief

The function selects a preferred value limited to a minimum and a maximum.

Useful to know

clamp() accepts minimum, preferred value and maximum. For example, font-size: clamp(1rem, 2vw, 2rem); allows the size to follow the width of the window, remaining within the specified limits. Arguments must be compatible with the type of value the property expects. [1]

This is convenient for a title that needs to be changed smoothly instead of jumping between several sizes. The above example illustrates the syntax; it is not a universal typographic setting for every font and language.

Check long titles, a narrow screen, and increased text. The presence of clamp does not automatically guarantee good readability or accessibility. If words go beyond the column, changes in width, carryover, or boundaries themselves may be necessary. Don't use the feature to lock the entire interface to the convenient size of a test screen.

Sources

For further detail and to check the information:

  1. [1] MDN — clamp ↗