Hacker News new | ask | show | jobs
by sfink 1757 days ago
I think rule-followed-by-exception is clearly superior because it's more flexible and generalizes better to future additions.

Except when it isn't superior. Like when the exception is pages of code below the rule.

Which means that precise (enabling) selectors are more robust since you don't have to worry about future CSS additions (or even whether to look for exceptions).

Which means that in general, general rules don't work very well.

2 comments

Yeah, just like "in theory, there's no difference between theory and practice; in practice, there is."
This stems from the incorrect (but popular) idiom of doing a container’s job by invading child properties. One can’t make it non-leaky neither to layout around, nor to a developer. These gaps are ones of the parent, not of a child, and anything else will leak.