From 625a41825e04060585e07021dd45ba9a7df1eee0 Mon Sep 17 00:00:00 2001 From: Anders Hartvoll Ruud Date: Thu, 7 Nov 2024 11:48:27 +0100 Subject: [PATCH] [@scope] Allow declarations directly within @scope Resolves #10389 --- css-cascade-6/Overview.bs | 43 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/css-cascade-6/Overview.bs b/css-cascade-6/Overview.bs index 454d365154c..15e5d972762 100644 --- a/css-cascade-6/Overview.bs +++ b/css-cascade-6/Overview.bs @@ -435,7 +435,7 @@ Syntax of ''@scope''
 	@scope [(<>)]? [to (<>)]? {
-	  <>
+	  <>
 	}
 	
@@ -445,7 +445,10 @@ Syntax of ''@scope'' used to identify the [=scoping root=](s). * <> is a <> [=selector=] used to identify any [=scoping limits=]. - * the <> represents the [=scoped style rules=]. + * the [=qualified rules=] within <>, + as well as any [=nested declarations rules=] + produced by [[#scoped-declarations|scoped declarations]], + represents the [=scoped style rules=]. [=Pseudo-elements=] cannot be [=scoping roots=] or [=scoping limits=]; they are invalid both within <> and <>. @@ -664,6 +667,39 @@ Issue(10795): Should the scope proximity calculation be impacted by nesting scop (e.g. within ''@layer'') are [=scoped style rules|scoped=]. +

+Scoped Declarations

+ + [=Declarations=] may be used directly + with the body of a ''@scope'' rule. + Contiguous runs of [=declarations=] + are wrapped in [=nested declarations rules=], + which match the [=scoping root=] + with zero [=specificity=]. + +
+
+		@scope (.foo) {
+		  border: 1px solid black;
+		}
+		
+ + is equivalent to: + +
+		@scope (.foo) {
+		  :where(:scope) {
+		    border: 1px solid black;
+		  }
+		}
+		
+
+ + Just like for [=style rules=], + [=declarations=] and child [=rules=] + may be [[css-nesting-1#mixing|mixed]] + within ''@scope''. +

Precedence of Non-CSS Presentational Hints

@@ -731,6 +767,9 @@ Changes since the 21 March 2023 Working Draft Significant changes since the 21 March 2023 Working Draft include: + * Allowed [=declarations=] directly within ''@scope''. + (Issue 10389) + * The '':scope'' selector can match the [=featureless=] [=shadow host=] when that host is the [=scoping root=] element. (Issue 9025)