sass/sass

Add support for `:has()`

nex3 opened this issue · 3 comments

nex3 commented

As of 19 February, the CSS working group has decided to move away from ! and towards :has() for indicating subject selectors. Sass should support this.

Based on the discussion linked above, it looks like the syntax will be E:has(F), where F can be any arbitrary selector, including one starting with a combinator (e.g. E:has(> F)).

nex3 commented

This will require deprecating the existing support for !.

I really like the ! syntax. What about just compiling it to the :has(...) syntax?

nex3 commented

I don't think there's enough syntactic benefit to justify the conceptual overhead of doing it in a different way than CSS. Plus it runs a serious risk of stepping on the toes of a future CSS feature.