[csswg-drafts] [css-nesting] wording `&&` "silly", but useful (#9113)

tobymackenzie has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-nesting] wording `&&` "silly", but useful ==
Not sure if this is the place to bring this up, but:  In the [CSS Nesting spec example 5](https://www.w3.org/TR/css-nesting-1/#example-31845edf), there is an example showing a nested `&&`, describing it as "Again, silly, but can even be doubled up."  The unnested equivalent of that example is:

``` css
.foo { color: blue; }
.foo.foo { padding: 2ch; }
```

It seems less silly when considering that the `.foo.foo` has double the specificity (0-2-0) of the `.foo` selector (0-1-0).  That is a somewhat common technique of increasing specificity without changing anything of the "query" of the selector.  Being able to chain the `&` in a nested selector makes it less verbose and easier to manage this technique, and it might be worth noting this to make it more apparent, or at least dropping the "silly" bit.

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


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

Received on Tuesday, 25 July 2023 04:50:28 UTC