postcss-remove-null

v1.2.1
PostCSS plugin that strips out any properties with a value of null
postcss css postcss-plugin remove null

postcss-remove-null Build Status

Remove null values with PostCSS.

Functionality

The basic use case of this plugin functions very similar to null in Sass.

Given

div {
  display: null;
}

The plugin will output

div {}

It's recommended that this plugin be followed by cssnano or postcss-discard-empty to ensure that the div in the above example is removed.

This plugin also intelligently handles nulls present in shorthand declarations.

Given

div {
  margin: null 1px null 2px;
}

The plugin will output

div {
  margin-right: 1px;
  margin-left: 2px;
}

For more insight on what the plugin currently covers checkout the tests;

Installation

npm install --save-dev postcss-remove-null

Usage

var postcss    = require('postcss');
var removeNull = require('postcss-remove-null');
var cssNano    = require('cssnano');

postcss([ removeNull, cssNano ])
npm i postcss-remove-null

Metadata

  • MIT
  • Whatever
  • zephraph
  • released 12/27/2015

Downloads

Maintainers