Hacker News new | past | comments | ask | show | jobs | submit login

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




Casacading !== inheritance. These are very different things. I wish we had inheritance (or traits) in CSS.


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...


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.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: