W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2020

[csswg-drafts] [selectors][css-nesting] Move nest-containing and nest-prefixed selector definitions to Selectors (#5745)

From: Lea Verou via GitHub <sysbot+gh@w3.org>
Date: Wed, 25 Nov 2020 17:14:20 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-750991719-1606324459-sysbot+gh@w3.org>
LeaVerou has just created a new issue for https://github.com/w3c/csswg-drafts:

== [selectors][css-nesting] Move nest-containing and nest-prefixed selector definitions to Selectors ==
Nest-prefixed: https://drafts.csswg.org/css-nesting/#nest-prefixed
Nest-containing: https://drafts.csswg.org/css-nesting/#nest-containing

These types of relative selectors are useful beyond nesting, as the ampersand can become a universal CSS `this` equivalent. E.g. I can imagine a qSA-like JS API that allows us to do things like `input.find("& + label")` or even compositions like `find("&.foo", "& > .bar", ".baz")`, or even HTML attributes that allow us to refer to elements relative to the current element (how useful that would have been with `label[for]`!)

Sure, there is also [`:scope`](https://drafts.csswg.org/selectors-4/#the-scope-pseudo), but there’s a reason we didn't base nesting off that.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5745 using your GitHub account

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 25 November 2020 17:14:23 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:22 UTC