Modular CSS Minifier

Modular CSS Minifier

github.com

1

About this website

A modern, modular CSS minifier and optimizer built on top of the PostCSS ecosystem, currently at version 8.0.2 with over 5,000 GitHub stars and 115 contributors. The tool goes far beyond simple whitespace removal, performing a comprehensive set of optimizations including color compression converting rgba to shorthand hex where possible, removal of comments and unnecessary semicolons, eliminating overridden at-rules and redundant declarations, normalizing unicode-range descriptors, mangling gradient parameters for smaller output values, converting between equivalent length units, merging adjacent selectors with identical rules, and removing unnecessary vendor prefixes through Browserslist integration. The preset system allows loading different optimization configurations depending on project needs, with a default preset performing safe transforms that preserve author intent, and an advanced preset performing more aggressive optimizations that may change rendering in edge cases but produce significantly smaller output. Each optimization is implemented as an independent PostCSS plugin, enabling fine-grained control over which transforms to enable or disable. The modular architecture also allows custom optimization passes to be added without modifying the core. Browserslist integration provides different output depending on target browsers, automatically removing vendor prefixes for properties already supported in the configured browser targets. The tool integrates with all major build systems including Webpack, Vite, Gulp, Grunt, and PostCSS CLI, with zero-configuration defaults that work out of the box. Tree-shaking support removes unused CSS rules when used with PurgeCSS or similar tools. The tool maintains source map generation for debugging minified output, and an online playground allows testing optimizations interactively without installation.

Tags & Categories

Statistics

1
Views
0
Clicks
0
Like
0
Dislike

Comments

Log In to post a comment

No comments yet. Be the first!