Search

CSS min() All The Things

Victor Ayomipo saw our post about using container units for everything. He was more optimistic than I that our result was good. My thinking is that there are plenty of things you straight up don’t want to use container units for. Victor did a similar exercise with (over?)-using min() and viewport units. Turns out there are lots of niceties, and I agree that min() is underused, but that you still can’t dogmatically say one particular sizing approach is always best. Personally, I’m rocking min() for container “width”, like .wrapper { inline-size: min(300px, 100dvw); on the regular now.

Wanna learn CSS from a course?

Frontend Masters logo

FYI, we have a full CSS learning path with multiple courses depending on how you want to approach it.

Leave a Reply

Your email address will not be published. Required fields are marked *

Frontend Masters ❤️ Open Source

Did you know? Frontend Masters Donates to open source projects. $313,806 contributed to date.