parcel-bundler / parcel-bundler/lightningcss

Lightning CSS doesn't escape `content: "\..."`

Open
#310 27 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

We have @charset "UTF-8"; in our CSS which Lightning CSS is skipping when bunding/minifying the styles.
Without it, it's possible to encounter issues with displaying unicode like in https://github.com/parcel-bundler/lightningcss/issues/164.
There are other ways to insert the character encoding like HTTP headers and the HTML but this is not possible for people in some use cases.

Is it possible to respect the @charset rule?

I've also prepared a Playground link demonstrating the issue.

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 supplied Playground reproduction and trace how Lightning CSS handles @charset during parsing and minification, especially the escaped content value. Compare the current output with the input and verify that UTF-8 encoding and the character rendering case from issue 164 are preserved. Done means the reported reproduction produces correct output without regressing other CSS processing.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.