Re:Help pick a syntax for CSS nesting
by dmitriid on Wednesday July 27, 2022 @05:15PM
(#32257084)
Casacading !== inheritance. These are very different things. I wish we had inheritance (or traits) in CSS.
[ Parent
| on HN ]
Re:Help pick a syntax for CSS nesting
by tambourine_man on Thursday July 28, 2022 @08:18AM
(#32263301)
Well tell me the difference then. We have cascading inheritance, that’s what CSS is all about.
Unless we’re using different definitions of the term
Casacading alpplies to all elements in the cascade. Whether you want it or not.
At the same time it's impossible to say "hey, I want to inherit from that particular style", and not have the cascade apply to it. For example, I want a button and I don't want anything in the hierarchy above overriding its borders, or colors, or fonts, or...
Re:Help pick a syntax for CSS nesting
by tambourine_man on Thursday July 28, 2022 @11:06AM
(#32265353)
Oh, I see. Arbitrary non hierarchical opt-in inheritance. Or perhaps a cascading inheritance opt-out, and you could add classes back as you please. That would be cool.
Not sure how it would impact browser parsing and drawing, but it sure would be useful.