githubEdit

PostCSS Nesting

NPM Versionarrow-up-right CSS Standard Statusarrow-up-right Build Statusarrow-up-right Support Chatarrow-up-right

PostCSS Nestingarrow-up-right lets you nest style rules inside each other, following the CSS Nestingarrow-up-right specification.

a, b {
  color: red;

  & c, & d {
    color: white;
  }
}

/* becomes */

a, b {
  color: red;
}

a c, a d, b c, b d {
  color: white;
}

NOTICE: In a future version of this project, nesting at-rules like @media may be deprecated, as they are not part of the nesting proposal. In a comment, a CSSWG member expressed interest in handling nested @media while handling selector nesting. So deprecating nested at-rules has been temporarily delayed.

Usage

Add PostCSS Nestingarrow-up-right to your project:

Use PostCSS Nestingarrow-up-right to process your CSS:

Or use it as a PostCSSarrow-up-right plugin:

PostCSS Nestingarrow-up-right runs in all Node environments, with special instructions for:

Last updated