3 ms·
Most of the time, yeah, but there's a corner case (example C from the article): a:hover { color: hotpink; :is(aside) & { color: red;
by notpushkin 4y ago
Most of the time, yeah, but there's a corner case (example C from the article):
a:hover {
color: hotpink;
:is(aside) & {
color: red;
}
}
Here, you can't just use `aside &` as this starts with a letter and will confuse the parser. Hence, wrapping with `:is()` is requires.
- culi 4y agoTbh, if this sort of "nesting" is possible in Sass, I don't think I've ever used it... Is it really necessary to support? I'd be cool with just simple nesting logic
- notpushkin 4y agoIt is definitely possible, just with a more complicated (and slow) parser than what browsers use now – there's been some discussion in this thread. As for whether it's necessary – eh, it's neat and might be useful sometimes but it's not a big deal I think. Personally, I remember a couple instances when I needed to override a few properties depending on context and it would be helpful, but `&:hover` is so much more useful.
- culi 4y agoRight and now that we have (or will, soon enough) `:has`, I really don't think it's worth mucking up the potentially very simple and sweet nesting syntax to support something that's probably usually a bad practice anyways (though obviously I'm speaking from a place of little experience using this)