parcel-bundler / parcel-bundler/lightningcss

Don't split unsupported selectors

Open
#759 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pending triage
Dominant language
Rust
Stars
7.7k
Forks
302
PR merge metrics
No merged PRs in 30d

Description

Version

1.25.1

input

.foo, .bar:baz {
  color: green;
}

output

.foo {
  color: green;
}

.bar:baz {
  color: green;
}

Browsers ignore the entire rule when it encounters the unsupported selector .bar:baz, but Lightning CSS parses it and changes it so that .foo is in effect, which is incorrect.

expected

Prints the warning and then outputs the original CSS as is.

.foo, .bar:baz {
  color: green;
}

Test in Browser

data:text/html;charset=UTF-8,<!doctype html>
<style>
.foo, .bar:baz { 
  color: green;
}
</style>
<div class="foo"> foo </div>

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

No source file or test is named in the issue. Reproduce the provided .foo, .bar:baz input and trace the selector parsing and splitting behavior; the fix is done when an unsupported selector keeps the whole rule intact, emits the warning, and a regression test covers the original CSS output.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, rust
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.