3 ms·
This and the parent comment confuse me. It's not the nesting in the SASS that's the problem per se, its the fact that it makes it easy to create the kind of co
by ZeroGravitas 11y ago
This and the parent comment confuse me.
It's not the nesting in the SASS that's the problem per se, its the fact that it makes it easy to create the kind of code that you list that's the problem.
Modern good practice suggests a single classname for each item, so you're not fighting with specificity too much.
The original "bad" example doesn't even do that, its just using :before and :after etc. not nested selectors.
- pcurve 11y agowhen you're building extremely large, reusable, single page applications, it's safer to go overboard with name-spacing via nesting. Alternative is to create descriptive, but potentially very lengthy class names that is single level.
- Kiro 11y agoThis is simply bad advice. The kind of nesting you showed will make the application non-maintainable. Your HTML gets completely locked down since its styling is dependent on things being nested in a certain way.