talira

A modular CSS minifier built on PostCSS

open sourceMITfree

cssnano is a modular CSS minifier built on PostCSS: it runs your CSS through many focused optimisations (removing whitespace, compressing identifiers and purging unnecessary definitions) so the production file is as small as possible. The default preset makes only safe optimisations, and an advanced preset adds techniques for more compression. It plugs into a build as a PostCSS plugin.

Problems it solves

  • minify CSS for production
  • shrink CSS bundle size in a PostCSS build
  • compress stylesheets safely without breaking them

Features

  • CSS minification through focused optimisations
  • safe default preset
  • advanced preset for more compression
  • PostCSS plugin

Alternatives

The same job

These do what cssnano does.

  1. Lightning CSS An extremely fast CSS parser, transformer, bundler, and minifier
  2. PostCSS A tool for transforming CSS with JavaScript
  3. postcss-import PostCSS plugin that inlines @import rules

Compare cssnano with the top 3