GUIDE深度 · Deep dive

What CSS Minification Does

Minifiers remove comments and whitespace, may shorten colors and zero values, and merge identical rules. They should not change selector meaning, but aggressive optimizations can break hacks or old browsers; regression-test before shipping.

更新 2026-10-31 · 公式可核验

Common optimizations

Remove comments and newlines.

#ffffff to #fff; 0px to 0.

Merge identical declarations and rules.

Relationship with gzip

gzip/Brotli already compress repetition, so minification gains shrink but remain.

Remove unused CSS first, then minify, for the biggest gain.

FAQ

Can minification break code?

Aggressive tools can; use mature tools and visual regression tests.

Should I keep source maps?

Yes; they help production debugging.

Sources

Related calculators

CSS MinifierRemove CSS comments, whitespace and redundant semicolons, with before/after sizes.

More guides

Critical CSS and PerformanceRead guide