parcel-bundler / parcel-bundler/lightningcss

semantic-ui-css stylesheet fails to parse

Open
#690 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

While checking all Next.js examples against Next.js with Turbopack (which uses lightningcss by default) we got a parsing issue reported related to semantic-ui-css package.

The CSS in node_modules/semantic-ui-css/semantic.min.css results in ERROR: Unexpected token Delim('.').

After digging to find a minimal reproduction I've found that in particular this line causes the error, when it's removed the file parses correctly:

[data-tooltip][data-inverted]:after .header {   background-color: none;   color: #fff; }

Here's a playground link that reproduces: https://lightningcss.dev/playground/index.html#%7B%22minify%22%3Atrue%2C%22customMedia%22%3Atrue%2C%22cssModules%22%3Afalse%2C%22analyzeDependencies%22%3Afalse%2C%22targets%22%3A%7B%22chrome%22%3A6225920%7D%2C%22include%22%3A0%2C%22exclude%22%3A0%2C%22source%22%3A%22%5Bdata-tooltip%5D%5Bdata-inverted%5D%3Aafter%20.header%20%7B%5Cn%20%20background-color%3A%20none%3B%5Cn%20%20color%3A%20%23fff%3B%5Cn%7D%22%2C%22visitorEnabled%22%3Afalse%2C%22visitor%22%3A%22%22%2C%22unusedSymbols%22%3A%5B%5D%2C%22version%22%3A%22local%22%7D

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

Reproduce the failure with the selector from node_modules/semantic-ui-css/semantic.min.css using the linked lightningcss playground. Trace how the Rust CSS parser handles this selector and verify that the stylesheet parses without Unexpected token Delim('.') while preserving the reported input.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.