1.0.0 • Published 10 years ago

postcss-strip-zero-length-units v1.0.0

Weekly downloads
572
License
MIT
Repository
github
Last release
10 years ago

PostCSS Strip Zero Length Units Build Status

PostCSS plugin to remove units from zero lengths.

Given any of the following css rules:

.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:

.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

postcss([ require('postcss-strip-zero-length-units') ])

See PostCSS docs for examples for your environment.