parcel-bundler / parcel-bundler/lightningcss

Optimize nested rules with :is

Open
#430 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.