Clamp for Fluid Type
clamp() lets headings grow with the screen between two sensible limits.
How we set it
Performance was not the goal, but it came along anyway. Fewer styles, fewer scripts and fewer images add up quickly.
- A minimum in rem
- A preferred value in vw plus rem
- A maximum that still fits a laptop
The first version looked plain. The second version looked busy. The third version, with half the details removed, is the one we kept.
Fluid type is only good if it stops growing somewhere.
We asked a few readers to try it with a keyboard only. Two of them found problems in under a minute, which is exactly why we asked.
Browser support is no longer the excuse it used to be. Everything in this post works in every current browser without a fallback.
If you only change one thing after reading this, make it the spacing. Consistent gaps make even a rough layout look intentional.
Colour is the last thing we add. Getting the structure right in black and white first saves a lot of arguing later.
10 thoughts on “Clamp for Fluid Type”
The list in the middle is worth the whole post.
Saving this for the next time someone asks for rounded corners.
This changed how I think about borders.
Printed this out and pinned it above my desk.
Bookmarked. This is going straight into our starter theme.
The screenshots sold me. Going to rebuild our card grid this weekend.
The screenshots sold me. Going to rebuild our card grid this weekend.
Any tips for doing this in an older theme?
I disagree on the shadows, but the rest is spot on.
The quote near the top is going on a sticky note.