margin-trim as a best practice?

Open link in next tab

margin-trim as a best practice? - Chris Coyier

https://chriscoyier.net/2023/06/12/margin-trim-as-a-best-practice/

It’s not every day there is a new “best practice” for CSS, since it’s such a huge, ubiquitous, and highly used language. But here’s one, maybe? If you add padding in the main flow direction of an element, adding margin-trim in that same direction. If you have both padding and margin in the same direction, […]

A great look at some considerations surrounding a very welcome improvement to margins in CSS.