parcel-bundler / parcel-bundler/lightningcss
unusedSymbols should also remove unused selectors when combined with a used selector
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7.7k
- Forks
- 302
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I've been trying to reduce the size of my minified CSS bundle via the unusedSymbols option, and I've noticed that lightningcss won't remove classes in the unusedSymbols list, if they are combined with a selector that is used.
If I set unusedSymbols to ["foo"] And then run lightningcss on this css file:
.foo, .bar {
color: red
}
I would assume the output would be:
.bar {
color: red
}
Instead, the output still contains the .foo class:
.foo, .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
Start by reproducing the unusedSymbols case with a comma-separated selector containing one unused and one used class. Add a regression test showing that the unused selector is removed while the used selector and declaration remain, then verify the existing test suite passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, rust
- Domain
- build-system, compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100