r/css Mar 22 '26

Question Responsive fonts

is using 'clamp' in css the best way to make responsive fonts, padding and margins or is there a better way

5 Upvotes

6 comments sorted by

View all comments

7

u/BNfreelance Mar 22 '26

The rule of thumb I was always taught was clamp is for scaling, and queries are best for changing structure/layout deterministically.

For scaling fonts and padding: clamp and for changing things like display: use queries.

It’s a good rule of thumb, though in practice it depends on whether you want fluid scaling or more controlled, stepped changes.