parcel-bundler / parcel-bundler/lightningcss
`@layer`s nested inside style rules are not merged
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7.7k
- Forks
- 302
- PR merge metrics
- No merged PRs in 30d
Description
When nesting an @layer inside a style rule it's properly lifted but multiple layers with the same name are not merged — whether minified or not. This merging typically happens even when not minifying but I think it would be acceptable if, to fix it, minification was required:
Input:
.foo {
@layer utilities {
color: red;
}
}
.baz {
@layer components {
color: red;
}
}
.bar {
@layer utilities {
color: red;
}
}
Expected:
@layer utilities {
.foo, .bar {
color: red;
}
}
@layer components {
.baz {
color: red;
}
}
Actual:
@layer utilities {
.foo {
color: red;
}
}
@layer components {
.baz {
color: red;
}
}
@layer utilities {
.bar {
color: red;
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior using the linked Playground or the CSS input in the issue, comparing minified and non-minified output. Trace the nested @layer lifting and merging path, then verify that repeated utilities layers are combined while the components layer remains separate and the expected output is produced.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100