File tree Expand file tree Collapse file tree 3 files changed +32
-3
lines changed
Expand file tree Collapse file tree 3 files changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,10 @@ export type Rule<D = Declaration, M = MediaQuery> = | {
8181 type : "container" ;
8282 value : ContainerRule < D , M > ;
8383 }
84+ | {
85+ type : "scope" ;
86+ value : ScopeRule < D , M > ;
87+ }
8488| {
8589 type : "starting-style" ;
8690 value : StartingStyleRule < D , M > ;
@@ -9125,6 +9129,29 @@ export interface ContainerRule<D = Declaration, M = MediaQuery> {
91259129 */
91269130 rules : Rule < D , M > [ ] ;
91279131}
9132+ /**
9133+ * A [@scope](https://drafts.csswg.org/css-cascade-6/#scope-atrule) rule.
9134+ *
9135+ * @scope (<scope-start>) [to (<scope-end>)]? { <stylesheet> }
9136+ */
9137+ export interface ScopeRule < D = Declaration , M = MediaQuery > {
9138+ /**
9139+ * The location of the rule in the source file.
9140+ */
9141+ loc : Location ;
9142+ /**
9143+ * Nested rules within the `@scope` rule.
9144+ */
9145+ rules : Rule < D , M > [ ] ;
9146+ /**
9147+ * A selector list used to identify any scoping limits.
9148+ */
9149+ scopeEnd ?: SelectorList | null ;
9150+ /**
9151+ * A selector list used to identify the scoping root(s).
9152+ */
9153+ scopeStart ?: SelectorList | null ;
9154+ }
91289155/**
91299156 * A [@starting-style](https://drafts.csswg.org/css-transitions-2/#defining-before-change-style-the-starting-style-rule) rule.
91309157 */
Original file line number Diff line number Diff line change @@ -259,8 +259,6 @@ export interface Resolver {
259259}
260260
261261export interface Drafts {
262- /** Whether to enable CSS nesting. */
263- nesting ?: boolean ,
264262 /** Whether to enable @custom-media rules. */
265263 customMedia ?: boolean
266264}
Original file line number Diff line number Diff line change @@ -17,7 +17,11 @@ use crate::visitor::Visit;
1717/// }
1818#[ derive( Debug , PartialEq , Clone ) ]
1919#[ cfg_attr( feature = "visitor" , derive( Visit ) ) ]
20- #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
20+ #[ cfg_attr(
21+ feature = "serde" ,
22+ derive( serde:: Serialize , serde:: Deserialize ) ,
23+ serde( rename_all = "camelCase" )
24+ ) ]
2125#[ cfg_attr( feature = "jsonschema" , derive( schemars:: JsonSchema ) ) ]
2226pub struct ScopeRule < ' i , R = DefaultAtRule > {
2327 /// A selector list used to identify the scoping root(s).
You can’t perform that action at this time.
0 commit comments