baldur
baldur

“The Rules of Margin Collapse”

Honestly, margin collapse in CSS was probably a bad idea and because I’m a lazy person I’ve mostly switched to flex/grid + gap to create this sort of spacing

|
Embed
Progress spinner
torb
torb

@baldur Like many early things in CSS I feel like they work well for their original intended purpose: spacing and flow in a linear document.

Considering we already have padding for non-collapsing spacing, I feel like margin is a nice option to have (though the inconsistencies are unfortunate for sure).

|
Embed
Progress spinner
In reply to
baldur
baldur

@torb Absolutely. And because flex/grid items create new block formatting contexts, margins become a little bit less inconsistent as well.

|
Embed
Progress spinner