Manuel Matuzovic: max() Trickery
By way of a post by Manuel Matuzović which is by way of a demo by Temani Afif.
.wrapper {
margin-inline: max(0px, ((100% - 64rem) / 2));
}
You’d be doing yourself a favor to read Manuel’s breakdown of …
By way of a post by Manuel Matuzović which is by way of a demo by Temani Afif.
.wrapper {
margin-inline: max(0px, ((100% - 64rem) / 2));
}
You’d be doing yourself a favor to read Manuel’s breakdown of …
There’s all kinds of ways to do that. Some more advisable and better-suited for certain situations than others, of course.…
I think this is good advice from Silvestar Bistrović:
An enabling selector is what I call a selector that does a job without disabling the particular rule.
The classic example is applying margin
to everything, only to have to remove …
The margin-inline-end
property in CSS defines the amount of space along the outer ending edge of an element in the inline direction. It’s included in the CSS Logical Properties Level 1 specification, which is currently in Working Draft.…
The margin-inline-start
property in CSS defines the amount of space along the outer starting edge of an element in the inline direction. It’s included in the CSS Logical Properties Level 1 specification, which is currently in Working Draft.…
Josh Comeau covers the concept of margin collapsing:
…This idea might sound simple, but if you’ve been writing CSS for a while, you’ve almost certainly been surprised when margins either don’t collapse, or they collapse in weird and unexpected ways.
Going with that title instead of the classic developer clickbait version Max used. ;)
We should ban margin from our components.
Don’t use margin?! This thing I’ve been doing my entire career and don’t have any particular problems with?!…
PPK digs into the subject, which he found woefully undercovered in web tech documentation. Our entry doesn’t mention them at all, which I’ll aim to fix.
Agree on this situation:
…This is by far the most common use case
Robin has covered this before, but I’ve heard some confusion about it in the past few weeks and saw another person take a stab at explaining it, and I wanted to join the party. …