4 ms·
AFAIK, this is just syntactic sugar. A shortcut. It’s not scoping in the inheritance sense. The C in CSS is for cascading. Inheriting is the natural way to be
by tambourine_man 4y ago
AFAIK, this is just syntactic sugar. A shortcut.
It’s not scoping in the inheritance sense. The C in CSS is for cascading. Inheriting is the natural way to be for CSS
- dmitriid 4y agoCasacading !== inheritance. These are very different things. I wish we had inheritance (or traits) in CSS.
- tambourine_man 4y agoWell 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
- dmitriid 4y agoCasacading 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...
- tambourine_man 4y agoOh, 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.