Re: [csswg-drafts] [css-nesting] :selector-replace() pseudo-class function (#6330)

> as an equivalent to this? `.foo .qux.active .bar .baz {}`

Well, technically I think it would be like `.foo .qux.active :is(.foo .bar .baz) {}`. `&`  matches the elements that match the parent selector. It doesn't directly insert a selector into another, you may need `:is()` if there are combinators.

> I’m not sure about the `&(foo)` syntax though

`&(foo)` was just some random syntax different than `&foo` which has another meaning. Can be something else.

> I believe the second & is actually not needed as (.foo) already makes it clear where the :focus belongs?

But it's not clear what's the relationship with `.baz`.

> shouldn’t this then work with direct nesting without `@nest`?

Probably, if it's at the beginning, I guess.

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6330#issuecomment-852309437 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 1 June 2021 17:28:51 UTC