Skip to content

Commit

Permalink
[css-nesting-1] Clarify that pseudo-elements can't yet be reprepresen…
Browse files Browse the repository at this point in the history
…ted by &. #7503 #7433
  • Loading branch information
tabatkins committed Oct 27, 2022
1 parent d30c9f6 commit c13755f
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions css-nesting-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,38 @@ Nesting Selector: the ''&'' selector {#nest-selector}
</pre>
</div>

The [=nesting selector=] cannot represent pseudo-elements
(identical to the behavior of the '':is()'' pseudo-class).

<div class=example>
For example, in the following style rule:

<pre class=lang-css>
.foo, .foo::before, .foo::after {
color: red;

&:hover { color: blue; }
}
</pre>

the ''&'' only represents the elements matched by ''.foo'';
in other words, it's equivalent to:

<pre class=lang-css>
.foo, .foo::before, .foo::after {
color: red;
}
.foo:hover {
color: blue;
}
</pre>
</div>

Issue: We'd like to relax this restriction,
but need to do so simultaneously for both '':is()'' and ''&'',
since they're intentionally built on the same underlying mechanisms.
(<a href="https://github.com/w3c/csswg-drafts/issues/7433">Issue 7433</a>)

The <a>specificity</a> of the <a>nesting selector</a>
is equal to the largest specificity among the complex selectors
in the parent style rule's selector list
Expand Down

0 comments on commit c13755f

Please sign in to comment.