🚀 DAY 3 OF LAUNCH WEEK: Introducing Webhook Events for Pull Request Scans.Learn more →
Socket
Book a DemoInstallSign in
Socket

postcss-normalize

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-normalize

Use the parts of normalize.css you need from your browserlist

Source
npmnpm
Version
3.0.0
Version published
Weekly downloads
3.2M
-3.02%
Maintainers
2
Weekly downloads
 
Created
Source

PostCSS Normalize PostCSS Logo

NPM Version Build Status Windows Build Status Gitter Chat

PostCSS Normalize lets you use the parts of normalize.css you need, based on your project’s browserlist.

Example:

/* { "browserlist": ["last 3 versions"] } */

/**
 * 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;
}
/* { "browserlist": ["last 2 versions"] } */

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

img {
  border-style: none;
}

PostCSS Normalize will put itself at the beginning of your CSS file, unless you dictate where it should be included:

@import-normalize;

Duplicate @import-normalize rules will be removed for your convenience. Only the first instance will be replaced.

PostCSS Normalize uses the non-opinionated version of normalize.css.

Usage

Add PostCSS Normalize to your build tool:

npm install postcss-normalize --save-dev

Add a browserlist entry in your package.json:

{
  "browserslist": "last 2 versions"
}

Node

Use PostCSS Normalize to process your CSS:

require('postcss-normalize').process(YOUR_CSS, { /* options */ });

PostCSS

Add PostCSS to your build tool:

npm install postcss --save-dev

Use PostCSS Normalize as a plugin:

postcss([
	require('postcss-normalize')({ /* options */ })
]).process(YOUR_CSS, /* options */);

Gulp

Add Gulp PostCSS to your build tool:

npm install gulp-postcss --save-dev

Use PostCSS Normalize in your Gulpfile:

var postcss = require('gulp-postcss');

gulp.task('css', function () {
	return gulp.src('./src/*.css').pipe(
		postcss([
			require('postcss-normalize')({ /* options */ })
		])
	).pipe(
		gulp.dest('.')
	);
});

Grunt

Add Grunt PostCSS to your build tool:

npm install grunt-postcss --save-dev

Use PostCSS Normalize in your Gruntfile:

grunt.loadNpmTasks('grunt-postcss');

grunt.initConfig({
	postcss: {
		options: {
			use: [
				require('postcss-normalize')({ /* options */ })
			]
		},
		dist: {
			src: '*.css'
		}
	}
});

Keywords

postcss

FAQs

Package last updated on 29 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts