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.
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.