parcel-bundler / parcel-bundler/lightningcss

Support `@media` nesting

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

Nobody has claimed this yet.

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

Description

Spec: https://drafts.csswg.org/css-nesting-1/#conditionals

.foo {
  display: grid;

  @media (orientation: landscape) {
    grid-auto-flow: column;

    @media (min-width > 1024px) {
      max-inline-size: 1024px;
    }
  }
}

/* equivalent to */
  .foo { display: grid; }

  @media (orientation: landscape) {
    .foo {
      grid-auto-flow: column;
    }
  }

  @media (orientation: landscape) and (min-width > 1024px) {
    .foo {
      max-inline-size: 1024px;
    }
  }

image

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

Read the linked CSS Nesting Level 1 specification and compare its conditional examples with the requested equivalence. Then inspect lightningcss's parser and compiler entry points to locate existing nesting and @media handling. Done means nested @media rules are transformed into the equivalent conditional rules shown in the issue, with coverage for nested conditions.

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.