• Version 6.0.1
  • Published
  • 13.9 kB
  • 1 dependency
  • MIT license


npm i postcss-nested
yarn add postcss-nested
pnpm add postcss-nested


PostCSS plugin to unwrap nested rules like how Sass does it



variable nested

const nested: PluginCreator<nested.Options>;


    interface Options

    interface Options {}

      property bubble

      bubble?: string[];
      • By default, plugin will bubble only @media, @supports and @layer at-rules. Use this option to add your custom at-rules to this list.

      property preserveEmpty

      preserveEmpty?: boolean;
      • By default, plugin will strip out any empty selector generated by intermediate nesting levels. You can set this option to true to preserve them.

      property rootRuleName

      rootRuleName?: string;
      • The plugin supports the SCSS custom at-rule @at-root which breaks rule blocks out of their nested position. If you want, you can choose a new custom name for this rule in your code.

      property unwrap

      unwrap?: string[];
      • By default, plugin will unwrap only @font-face, @keyframes, and @document at-rules. You can add your custom at-rules to this list by this option.

      Type Aliases

      type Nested

      type Nested = PluginCreator<Options>;

        Package Files (1)

        Dependencies (1)

        Dev Dependencies (0)

        No dev dependencies.

        Peer Dependencies (1)


        To add a badge like this badgeto your package's README, use the codes available below.

        You may also use to create a custom badge linking to

        • Markdown
        • HTML
          <a href=""><img src="" alt=""></a>