@@ -438,7 +438,7 @@ Syntax of ''@scope''</h4>
438
438
439
439
<pre class="prod def">
440
440
@scope [(<<scope-start>> )]? [to (<<scope-end>> )]? {
441
- <<rule-list >>
441
+ <<block-contents >>
442
442
}
443
443
</pre>
444
444
@@ -448,7 +448,10 @@ Syntax of ''@scope''</h4>
448
448
used to identify the [=scoping root=] (s).
449
449
* <dfn><<scope-end>></dfn> is a <<selector-list>> [=selector=]
450
450
used to identify any [=scoping limits=] .
451
- * the <<rule-list>> represents the [=scoped style rules=] .
451
+ * the [=qualified rules=] within <<block-contents>> ,
452
+ as well as any [=nested declarations rules=]
453
+ produced by [[#scoped-declarations|scoped declarations]] ,
454
+ represents the [=scoped style rules=] .
452
455
453
456
[=Pseudo-elements=] cannot be [=scoping roots=] or [=scoping limits=] ;
454
457
they are invalid both within <<scope-start>> and <<scope-end>> .
@@ -667,6 +670,39 @@ Issue(10795): Should the scope proximity calculation be impacted by nesting scop
667
670
(e.g. within ''@layer'' )
668
671
are [=scoped style rules|scoped=] .
669
672
673
+ <h4 id="scoped-declarations">
674
+ Scoped Declarations </h4>
675
+
676
+ [=Declarations=] may be used directly
677
+ with the body of a ''@scope'' rule.
678
+ Contiguous runs of [=declarations=]
679
+ are wrapped in [=nested declarations rules=] ,
680
+ which match the [=scoping root=]
681
+ with zero [=specificity=] .
682
+
683
+ <div class=example>
684
+ <pre highlight=css>
685
+ @scope (.foo) {
686
+ border: 1px solid black;
687
+ }
688
+ </pre>
689
+
690
+ is equivalent to:
691
+
692
+ <pre highlight=css>
693
+ @scope (.foo) {
694
+ :where(:scope) {
695
+ border: 1px solid black;
696
+ }
697
+ }
698
+ </pre>
699
+ </div>
700
+
701
+ Just like for [=style rules=] ,
702
+ [=declarations=] and child [=rules=]
703
+ may be [[css-nesting-1#mixing|mixed]]
704
+ within ''@scope'' .
705
+
670
706
<h3 id="preshint">
671
707
Precedence of Non-CSS Presentational Hints</h3>
672
708
@@ -734,6 +770,9 @@ Changes since the 21 March 2023 Working Draft</h3>
734
770
Significant changes since the
735
771
<a href="https://www.w3.org/TR/2023/WD-css-cascade-6-20230321/">21 March 2023 Working Draft</a> include:
736
772
773
+ * Allowed [=declarations=] directly within ''@scope'' .
774
+ (<a href="https://github.com/w3c/csswg-drafts/issues/10389">Issue 10389</a> )
775
+
737
776
* The '':scope'' selector can match the [=featureless=] [=shadow host=] when
738
777
that host is the [=scoping root=] element.
739
778
(<a href="https://github.com/w3c/csswg-drafts/issues/9025">Issue 9025</a> )
0 commit comments