parcel-bundler / parcel-bundler/lightningcss
Possible to use nesting as minification feature
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7.7k
- Forks
- 302
- PR merge metrics
- No merged PRs in 30d
Description
Is it possible for lightningcss to shorten selectors to use nesting, now with modern browser supporting css nesting?
So for example if the input is
.test .a {
background: red
}
.test .b {
background: yellow;
}
I'd want lightningcss to output .test{.a{background:red}.b{background:yellow}}
Reason for that is that SASS isn't going to output native nesting for now: https://sass-lang.com/blog/sass-and-native-nesting/
But I think that by doing so my styles that heavily use sass nesting could be greatly reduced in output size. So if lightningcss could just try to create nesting using some heuristics and use the result if it's smaller that would be greatly appreciated :)
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
No files, tests, or entry points are identified in the issue. Start by locating lightningcss's selector minification and CSS nesting handling, then measure the supplied examples; done means safely emitting native nesting only when the result is smaller and preserving equivalent styles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100