You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Finding Layer in tree should not have to search for LAYER_NAME #195
There will be some nuances around how we should handle the surrounding (), because I believe that's part of why we initially chose to structure the AST as described in the comments below.
Activity
bartveneman commentedon Oct 21, 2026
Encountered the same for this CSS:
bartveneman commentedon Oct 21, 2026
Same for suppoorts queries:
bartveneman commentedon Oct 21, 2026
The csstree AST seems very reasonable for the layer scenario:
{ "type": "StyleSheet", "children": [ { "type": "Atrule", "name": "import", "prelude": { "type": "AtrulePrelude", "children": [ { "type": "Url", "value": "test.css" }, { "type": "Function", "name": "layer", "children": [ { "type": "Layer", "name": "test.me" } ] } ] }, "block": null }, { "type": "Atrule", "name": "layer", "prelude": { "type": "AtrulePrelude", "children": [ { "type": "LayerList", "children": [ { "type": "Layer", "name": "test.me" } ] } ] }, "block": { "type": "Block", "children": [] } }, { "type": "Atrule", "name": "layer", "prelude": { "type": "AtrulePrelude", "children": [ { "type": "LayerList", "children": [ { "type": "Layer", "name": "test.me" }, { "type": "Layer", "name": "a" } ] } ] }, "block": null } ] }bartveneman commentedon Oct 21, 2026
csstree AST for supports goes a little different:
{ "type": "StyleSheet", "children": [ { "type": "Atrule", "name": "import", "prelude": { "type": "AtrulePrelude", "children": [ { "type": "Url", "value": "test.css" }, { "type": "Function", "name": "supports", "children": [ { "type": "Declaration", "important": false, "property": "display", "value": { "type": "Value", "children": [ { "type": "Identifier", "name": "grid" } ] } } ] } ] }, "block": null }, { "type": "Atrule", "name": "supports", "prelude": { "type": "AtrulePrelude", "children": [ { "type": "Condition", "kind": "supports", "children": [ { "type": "SupportsDeclaration", "declaration": { "type": "Declaration", "important": false, "property": "display", "value": { "type": "Value", "children": [ { "type": "Identifier", "name": "grid" } ] } } } ] } ] }, "block": { "type": "Block", "children": [] } } ] }feat!: wrap @import layer() and supports() in a Function node (#318)
bartveneman commentedon Oct 21, 2026
fixed in #318