DEV Community

Discussion on: CSS media query : how to make website responsive

Collapse
 
itsvitoracacio profile image
Vitor Acacio

I also placed a lot of importance in media queries until I learned about the clamp function. It lets you specify a minimum and maximum sizes (in absolute size) and an ideal size between them (in relative size). It's good to be paired with minmax too.

Works great for responsive elements sizes, but where it excels is with making font sizes responsives. I was amazed that after learning this, I was able to reduce a lot of the rules that needed to vary per media query and I was able to cut my stylesheets by half.

Some comments have been hidden by the post's author - find out more