2 ms·
I'm sorry but I can't continue to take your suggestion that "global typographic styles suck" when you advocate using: .copy * { margin:0 0 $text-baseline 0
by chrisacky 14y ago
I'm sorry but I can't continue to take your suggestion that "global typographic styles suck" when you advocate using:
.copy * { margin:0 0 $text-baseline 0; }
There is nothing wrong with correct use of cascading styles. If you are finding that you are constantly changing the styles, then you are doing it wrong and making poor choices in your inheritance/"super" selector.
(While, on the topic, you know that CSS selectors/rules are applied and read, from right to left. This is how the inheritance works. Using your "reset" would mean that you are slowing down the CSS rendering considerably by matching * wildcard, and then limiting the selector to only .copy elements. It's probably the biggest single anti-pattern in CSS. Don't do it.
- anthonyshort 14y agoI think you've missed the point. I'm not saying that using the cascade is bad, I'm saying that you need to have better control over it. Applying styles in the global scope gives you no control over it. When I say "global type styles" I'm referring to styles in the global scope, not cascaded styles. You need to be able to separate your styles into layout and decoration for them to be re-usable. Anything in the global scope becomes a problem. It's the same as writing modular code in any other language. Regarding the rendering speed, it has been proven multiple times that the performance impact of wildcard selectors is so unnoticeable it's not worth even worrying about at all. When you build anything large enough that needs to be maintained and scaled by a team of people you need to limit to the cascading of styles or your stylesheets will grow out of control. So yes, the cascade can bite you in the ass and does suck unless you know how to control it.