parcel-bundler / parcel-bundler/lightningcss

`u + a` selector is minified to `u+a`

Open
#289 10 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

u + a {
  color: green;
}

becomes :

u+a{color:green}

I expected lightningcss to avoid forming <urange> tokens.

https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#urange-syntax

There are likely more error cases.


Link text is #ff0000 because u+a is not a valid selector.

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>

	<style>
		u + a{color:red}

		u+a{color:green}
	</style>
</head>
<body>
	<u>Underlined</u>
	<a href="#">A link</a>
</body>
</html>

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 issue with the supplied u + a stylesheet and compare the minified output with the linked CSS Syntax urange rules. Trace the selector minification path in lightningcss, then verify that this case remains a valid selector and add coverage for the reported regression and any related token-boundary cases identified during investigation.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.