githubEdit

PostCSS Normalize

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

PostCSS Normalizearrow-up-right lets you use the parts of normalize.cssarrow-up-right or sanitize.cssarrow-up-right that you need from your browserslistarrow-up-right.

@import "normalize.css";
@import "sanitize.css";

PostCSS Normalize uses a non-opinionated version of normalize.cssarrow-up-right, but an opinionated version may also be used.

@import "normalize.css/opinionated.css";

Examples

Here is a sample of what normalize.css looks like when the browserslist is ie >= 9:

/**
 * Add the correct display in IE 9-.
 */

audio,
video {
  display: inline-block;
}

/**
 * Remove the border on images inside links in IE 10-.
 */

img {
  border-style: none;
}

And here is the same sample when the browserslist is ie >= 10:

Usage

Add PostCSS Normalizearrow-up-right to your project:

Add a browserslistarrow-up-right entry in package.json:

Use PostCSS Normalize to process your CSS:

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

PostCSS Normalize runs in all Node environments, with special instructions for:

PostCSS Import Usage

PostCSS Normalize includes a postcssImport function to configure PostCSS Importarrow-up-right and allow you to continue using the @import syntax.

Alternatively, use @import-normalize or @import-sanitize to avoid conflicts with @import transforms.

Options

allowDuplicates

The allowDuplicates option determines whether multiple, duplicate insertions of CSS libraries are allowed. By default, duplicate libraries are omitted.

forceImport

The forceImport option defines CSS libraries that will be inserted at the beginning of the CSS file. Unless overriden by allowDuplicates, duplicate CSS libraries would still be omitted.

Specific CSS libraries may be defined.

browsers

The browsers option defines an override of the project’s browserslist for PostCSS Normalize. This option should be avoided in leui of a browserslist file.

CSS Libraries

PostCSS Normalize can include normalize.cssarrow-up-right or sanitize.cssarrow-up-right and configure either with the following combinations:

Last updated