postcss-strip-zero-length-units

PostCSS plugin to remove units from zero lengths.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
postcss-strip-zero-length-units
1.0.07 years ago7 years agoMinified + gzip package size for postcss-strip-zero-length-units in KB

Readme

PostCSS Strip Zero Length Units !Build Statusci-imgci
PostCSS plugin to remove units from zero lengths. Given any of the following css rules: ```css .foo { width: 0em; } .foo { width: 0ex; } .foo { width: 0ch; } .foo { width: 0vw; } .foo { width: 0vh; } .foo { width: 0cm; } .foo { width: 0mm; } .foo { width: 0in; } .foo { width: 0pt; } .foo { width: 0pc; } .foo { width: 0px; } .foo { width: 0rem; } .foo { width: 0vmin; } .foo { width: 0vmax; } ``` They will be transformed to: ```css .foo { width: 0; } ```

Unhandled Cases

Currently, the plugin only handles zero lengths in declarations. It does not handle:
  • Zero lengths in media queries.
  • Zero lengths in functions.
  • Any other zero lengths.

Usage

```js postcss( require('postcss-strip-zero-length-units') ) ``` See PostCSS docs for examples for your environment.