Background
Coming from T312822 and another patch recently merged into Vector, I would like to propose not relying on transparent borders to prevent margin collapsing.
It is error-prone in theming environment, as border colors might generally be overridden.
Vector already mixes two different approaches:
- the border: npx solid transparent and margin-top: negative-border and
- the padding-top: 0.05px
Goal
Provide a mixin or a variable in core to prevent margin collapsing.
Developer notes
Take into account that parent>child and adjacent elements collapsible margins are necessary to be handled differently.
display: flow-root is forward-looking solution (no IE11 support) for parent-child margin collapsing:
https://caniuse.com/?search=flow-root