parcel-bundler / parcel-bundler/lightningcss
Optimize nested rules with :is
Open
Nobody has claimed this yet.
area: minification
area: transpilation
- Dominant language
- Rust
- Stars
- 7.7k
- Forks
- 302
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
Considering the following nested CSS:
.accordion {
& .one, & .two {
}
}
LightningCSS will currently generates this:
.accordion .one, .accordion .two {
}
Would not be equivalent to the shorter:
.accordion :is(.one, .two) {
}
The specificity would be the same here so I think this would not cause specific issue?
Thanks!
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
Use the nested CSS example in the issue as the reproduction and compare LightningCSS's current expanded selector with the proposed :is form. Done means the shorter output is produced where equivalent without changing selector specificity or behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, rust
- Domain
- compilers, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100