parcel-bundler / parcel-bundler/lightningcss

Can media queries use custom units?

Open
#767 1 comment 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

Use px units for media queries, convert to rem
@media screen and (max-width: 1000px) {
.test {
width: 100px;
}
}

But I use custom units and expect no px conversion, which will cause the media query style to be lost
@media screen and (max-width: 1000customPx) {
.test {
width: 100px;
}
}

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 by tracing how lightningcss converts px units in media-query conditions, then look for tests covering @media unit handling. Use the examples in the issue to verify that ordinary px values retain their current conversion while custom units remain unchanged. Done means the custom-unit media query is not lost during transformation.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, rust
Domain
compilers, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.