Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I am supportive of this. Ofc, parent selector would still be nice, but I understand the problems solving that performantly.

As a highlight, Nested CSS doesn't support nested selectors if they both begin with letters, so the "&" is used as divider.

I highly recommend web-dev's check out the last section of the article*: https://webkit.org/blog/13813/try-css-nesting-today-in-safar...

[*: even though, IMO, in this instance it seems like a hack; nesting CSS styles, while the HTML is nested in the opposite direction seems pretty counterintuitive. but having the tool in your toolbox could be useful for other things.]



Do you know about the `:has()` pseudo-selector? It is basically a parent selector, and has decent browser support already!

* https://developer.mozilla.org/en-US/docs/Web/CSS/:has


We have a parent selector. It's called :has(), and Firefox is the only holdout at this point.


You can enable it with a flag in Firefox though. If only I could enable subgrid with a Blink flag though ha.


You can enable :has in Firefox, but it's buggy and still very experimental at this point. Or at least it was a month or so ago.


The flag you're looking for is --enable-blink-features=LayoutNGSubgrid, I assume.




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

Search: