parcel-bundler / parcel-bundler/lightningcss

Minifier: Drop Redundant Doubled Properties?

Open
#47 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: minification
Dominant language
Rust
Stars
7.7k
Forks
302
PR merge metrics
No merged PRs in 30d

Description

Hi @devongovett ! 👋 First of all, thanks for all of your effort on this, really amazing for the community to have such a great tool!

I was looking for a feature of @parcel/css that would allow for removal of duplicate properties.

For example:

Input

div {
  color: green;
  color: red;
}

@parcel/css Output (Playground Link)

div{color:green;color:red}

Expected Output

div{color:red}

However, it could be a problem with my understanding of the CSS spec somehow, because I see that some duplicated properties do indeed get dropped:

Input

div {
  background: green;
  background: red;
}

@parcel/css Output (Playground Link)

div{background:red}

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

Start with the two CSS examples and their linked @parcel/css Playground outputs, then check the CSS specification rules for removing earlier declarations without changing fallback behavior. Done means redundant doubled properties such as color are safely removed while valid duplicate-declaration cases remain preserved, matching the expected output.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.