The two most needed CSS properties for better web typography are Text-Box-Trim, as well as Margin-Trim
Please browser dev’s, implement both of these.
https://developer.mozilla.org/en-US/docs/Web/CSS/margin-trim
—-
Here’s a JS hack in the mean-time:
The two most needed CSS properties for better web typography are Text-Box-Trim, as well as Margin-Trim
Please browser dev’s, implement both of these.
https://developer.mozilla.org/en-US/docs/Web/CSS/margin-trim
—-
Here’s a JS hack in the mean-time:
Is it designed to do more than just that, or is it just about avoiding gaps at the start and end of lines of elements?
Flex with gap is also an alternative to that, and in my view should be the default thing you reach for. But there are some cases where the child margin approach has benefits, particularly if you're doing certain animations/transitions or if you want each child to essentially override its top or bottom gap.
Like, I understand the situation, I've been in that place plenty of times. But I've never felt in want of a solution there.
* {
margin: 0;
padding: 0;
}
* + * {
margin-top: 1em;
}