A fast and efficient CSS optimizer for Node.js and the browser, offering advanced minification and optimization.
clean-css is a CSS minification and optimization library for Node.js and the browser. It reduces CSS file size by removing unnecessary characters, merging rules, and applying advanced optimizations, which improves website loading times and performance. It is one of the most efficient CSS minifiers available according to benchmarks.
Frontend developers, build engineers, and anyone using Node.js-based build tools (like Webpack, Gulp, or Grunt) who need to optimize CSS for production. It's also suitable for developers working on performance-critical web applications.
Developers choose clean-css for its speed, extensive optimization options, and reliability. It offers fine-grained control over minification levels, compatibility settings, and source map generation, making it a versatile and trusted tool in the frontend optimization pipeline.
Fast and efficient CSS optimizer for node.js and the Web
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers configurable levels from 0 to 2, allowing precise balancing of minification aggressiveness, such as disabling specific optimizations or enabling advanced restructuring for maximum size reduction.
Provides fine-tuned compatibility modes for Internet Explorer 7+ and modern browsers, with options to control property merging, unit handling, and selector hacks to maintain cross-browser support.
Allows custom optimizations via plugins for level 1 and 2, enabling developers to add property or value transformations, as shown in the examples for removing repeated background-repeat values.
Supports generating and working with source maps for debugging minified CSS, including input source map handling and embedding sources via the sourceMapInlineSources option.
The project is officially in maintenance mode, meaning fewer updates, delayed bug fixes, and no new features, which could impact long-term support for evolving CSS standards.
Major versions (e.g., 4.0 and 5.0) introduced significant breaking changes, such as default compatibility shifts and API splits, requiring migration efforts and potential code adjustments.
With numerous options for optimization levels, compatibility, formatting, and inlining, setup can be overwhelming for simple use cases, leading to unnecessary complexity in basic pipelines.