Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"lint": "oxlint && oxfmt --check"
},
"dependencies": {
"@projectwallace/css-parser": "~0.16.0"
"@projectwallace/css-parser": "~0.17.0"
},
"devDependencies": {
"@projectwallace/preset-oxlint": "^0.0.11",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ export function layer_tree_from_ast(ast: CSSNode): TreeNode[] {
if (node.has_prelude) {
let groups = node.prelude.text.split(',').map((s) => s.trim())
if (node.has_block) {
// prelude.children contains the individual segments for dotted notation
// e.g., @layer base.props {} has children: ["base", "props"]
// prelude.children contains one LayerName node per dotted notation,
// e.g., @layer base.props {} has a single child with name "base.props"
let layer_names: string[] = []
if (is_atrule_prelude(node.prelude)) {
for (let child of node.prelude.children) {
if (is_layer_name(child)) {
layer_names.push(child.name)
layer_names.push(...get_layer_names(child.name))
}
}
}
Expand Down Expand Up @@ -112,7 +112,7 @@ export function layer_tree_from_ast(ast: CSSNode): TreeNode[] {
let layer_count = 0
for (let child of node.prelude.children) {
if (is_layer_name(child)) {
layer_count++
layer_count += get_layer_names(child.name).length
}
}
// Pop all of them
Expand Down
Loading