https://github.com/zephraph/postcss-remove-null
Remove null values with PostCSS
https://github.com/zephraph/postcss-remove-null
Last synced: 12 months ago
JSON representation
Remove null values with PostCSS
- Host: GitHub
- URL: https://github.com/zephraph/postcss-remove-null
- Owner: zephraph
- License: mit
- Created: 2015-11-21T17:19:34.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-06-18T13:20:00.000Z (almost 9 years ago)
- Last Synced: 2024-04-23T18:50:04.999Z (almost 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 18.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# postcss-remove-null [](https://travis-ci.org/zephraph/postcss-remove-null)
> Remove null values with PostCSS.
## Functionality
The basic use case of this plugin functions very similar to `null` in Sass.
Given
```css
div {
display: null;
}
```
The plugin will output
```css
div {}
```
It's recommended that this plugin be followed by [cssnano](https://github.com/ben-eb/cssnano) or [postcss-discard-empty](https://github.com/ben-eb/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
```css
div {
margin: null 1px null 2px;
}
```
The plugin will output
```css
div {
margin-right: 1px;
margin-left: 2px;
}
```
For more insight on what the plugin currently covers checkout the [tests](https://github.com/zephraph/postcss-remove-null/tree/master/tests);
## Installation
`npm install --save-dev postcss-remove-null`
## Usage
```javascript
var postcss = require('postcss');
var removeNull = require('postcss-remove-null');
var cssNano = require('cssnano');
postcss([ removeNull, cssNano ])
```