Skip to content

Commit c13755f

Browse files
committed
[css-nesting-1] Clarify that pseudo-elements can't yet be reprepresented by &. #7503 #7433
1 parent d30c9f6 commit c13755f

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

css-nesting-1/Overview.bs

+32
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,38 @@ Nesting Selector: the ''&'' selector {#nest-selector}
709709
</pre>
710710
</div>
711711

712+
The [=nesting selector=] cannot represent pseudo-elements
713+
(identical to the behavior of the '':is()'' pseudo-class).
714+
715+
<div class=example>
716+
For example, in the following style rule:
717+
718+
<pre class=lang-css>
719+
.foo, .foo::before, .foo::after {
720+
color: red;
721+
722+
&:hover { color: blue; }
723+
}
724+
</pre>
725+
726+
the ''&'' only represents the elements matched by ''.foo'';
727+
in other words, it's equivalent to:
728+
729+
<pre class=lang-css>
730+
.foo, .foo::before, .foo::after {
731+
color: red;
732+
}
733+
.foo:hover {
734+
color: blue;
735+
}
736+
</pre>
737+
</div>
738+
739+
Issue: We'd like to relax this restriction,
740+
but need to do so simultaneously for both '':is()'' and ''&'',
741+
since they're intentionally built on the same underlying mechanisms.
742+
(<a href="https://github.com/w3c/csswg-drafts/issues/7433">Issue 7433</a>)
743+
712744
The <a>specificity</a> of the <a>nesting selector</a>
713745
is equal to the largest specificity among the complex selectors
714746
in the parent style rule's selector list

0 commit comments

Comments
 (0)