> I think gap is where this is all headed in the long term. gap? Is this new? I've been waiting for years for CSS to finally support something like that. Always thought it was weird that I had to mess with margins (and last-child hacks) to get a proper gap between items in a container.
You want enabling CSS selectors, not disabling ones
11–20 of 120 posts
Re: You want enabling CSS selectors, not disabling ones
#12> I think gap is where this is all headed in the long term. gap? Is this new? I've been waiting for years for CSS to finally support something like that. Always thought it was weird that I had to mess with margins (and last-child hacks) to get a proper gap between items in a container.
Re: You want enabling CSS selectors, not disabling ones
#13> I think gap is where this is all headed in the long term. gap? Is this new? I've been waiting for years for CSS to finally support something like that. Always thought it was weird that I had to mess with margins (and last-child hacks) to get a proper gap between items in a container.
It's part of CSS grid so in a way it's new, but CSS grid well supported nowadays.
Edit: just checked, Safari 14.1 added support for using gap with Flexbox.
Re: You want enabling CSS selectors, not disabling ones
#14> I think gap is where this is all headed in the long term. gap? Is this new? I've been waiting for years for CSS to finally support something like that. Always thought it was weird that I had to mess with margins (and last-child hacks) to get a proper gap between items in a container.
It's part of CSS grid so in a way it's new, but CSS grid well supported nowadays.
Re: You want enabling CSS selectors, not disabling ones
#15But in practice while creating interfaces, we're making broad brush strokes, then accommodating exceptions, like :last-child.
Also curious about how browsers prioritize the render stages – does every style get applied sequentially (hence cascading), or do pseudo selectors get applied later during the paint?
Re: You want enabling CSS selectors, not disabling ones
#16I don't see why 0 should be treated as special value. Initial should be used if meant to "disable" it. What if you want margin: 5px as the general rule and margin: 10px on the last element. Is 10px a disabling selector?
I believe that's exactly the point. You don't set all to 5px and then override using a special rule that says 0px for the last. You exclude the last element from the 5px rule. There might be other rules, browser, user that should not over the 5px rule
- When special cases are added or removed, the general rule won't have to be adjusted, just code that handles the special cases.
- On the other hand, a single general rule that specifically avoids application to multiple exceptional cases will be pretty long and have multiple :not()s, thus reducing readability and maintainability.
Why burden the general rule with knowledge of its exceptions? To me, doing so is a (small) violation of the principle of separation of concerns.
Re: You want enabling CSS selectors, not disabling ones
#17Re: You want enabling CSS selectors, not disabling ones
#18Interesting way to think – we use additive color (RGB) on web so why not additive styling? But in practice while creating interfaces, we're making broad brush strokes, then accommodating exceptions, like :last-child. Also curious about how browsers prioritize the render stages – does every style get applied sequentially (hence cascading), or do pseudo selectors get applied later during the paint?
Re: You want enabling CSS selectors, not disabling ones
#19Re: You want enabling CSS selectors, not disabling ones
#20Earlier quoted context omitted.
I believe that's exactly the point. You don't set all to 5px and then override using a special rule that says 0px for the last. You exclude the last element from the 5px rule. There might be other rules, browser, user that should not over the 5px rule
I disagree. If a 5px margin is the general rule, then I would argue it's cleaner to apply it generally, and then apply the 10px margin exceptions in separate rules. - When special cases are added or removed, the general rule won't have to be adjusted, just code that handles the special cases. - On the other hand, a single general rule that specifically avoids application to multiple exceptional cases will be pretty l…