clamp is a function in CSS which claps a given value (default) between the minimum and maximum

Опубликовано: 29 Октябрь 2024
на канале: CodeMentor
2,236
251

💬 clamp is a function in CSS which claps a given value (default) between the minimum and maximum

Essentially, this example can be written as follows:

width: min(100px, max(75%, 200px))

But the clamp function is much cleaner, easy to read and shorter 🤩

Have you used this function before? Share your thoughts in the comments below 🔥