Without the new property margin-trim
, I’m forever doing :last-child { margin-block-end: 0; }
and things like that to prevent an elements margin from combining with a parent elements padding to make too much space. The fact that we can avoid the extra awkward targeting and removal rule with this is great. I’ll stick by Coyier’s Padding Law:
When you add
padding
to a container element, addmargin-trim
in the same directions.