postcss-cull-units

PostCSS plugin that removes redundant units

Usage no npm install needed!

<script type="module">
  import postcssCullUnits from 'https://cdn.skypack.dev/postcss-cull-units';
</script>

README

PostCSS Cull Units

Build Status

PostCSS plugin that removes redundant units.

.foo {
    border: 1px solid #0F0103;
    margin: 0rem 5rem;
    padding: 0cm;
    width: 50vw
}
.foo {
    border: 1px solid #0F0103;
    margin: 0 5rem;
    padding: 0;
    width: 50vw
}

Usage

Check you project for existed PostCSS config: postcss.config.js in the project root, "postcss" section in package.json or postcss in bundle config.

If you already use PostCSS, add the plugin to plugins list:

module.exports = {
  plugins: [
+   require('postcss-cull-units'),
    require('autoprefixer')
  ]
}

If you do not use PostCSS, add it according to official docs and set this plugin in settings.