CSS Minification Techniques That Actually Shrink Your Files
Minification removes whitespace, not bad CSS. Here is how I shrink stylesheets by rewriting them before the minifier ever runs. CSS minification is one of the easiest performance wins on a website, and it is also one of the most misunderstood. Developers often assume that turning on minification is enough, then wonder why their stylesheets still weigh more than expected. The truth is that minification removes what is safe to remove, and what is safe depends on how the CSS was written. Here is how I approach CSS minification, what I strip out manually before minifying, and where online minifiers fit into my workflow. What Minification Actually Removes A CSS minifier removes characters that the browser does not need to understand the stylesheet. That means comments, whitespace, and unnecessary semicolons. It does not change the rules themselves. A selector that matches ten elements still matches ten elements after minification. A property with a redundant value stays redundant. Minification shrinks the file; it does not optimize the CSS inside it. This distinction matters because developers often expect minification to fix bloated CSS. It cannot. More tutorials are on the KitCraft Blog.