Skip to content

eriklharper/postcss-nested-import

Repository files navigation

PostCSS Nested Import

PostCSS plugin for importing other stylesheet source files anywhere in your CSS.

GitHub CI test

Before:

/* vendor.css */
.vendor {
  background: silver;
}

/* index.css */
:global {
  @nested-import './vendor.css';
}

After:

:global {
  .vendor {
    background: silver;
  }
}

Usage

postcss([require("postcss-nested-import")]);

See PostCSS docs for examples for your environment.