The calc() bug this tool deliberately avoids#
CSS's calc() function requires whitespace around a + or - operator — calc(100% - 32px) is valid, calc(100% -32px) is a syntax error, because the parser cannot tell whether that -32px is a subtraction or a negative length. A minifier that aggressively strips all whitespace around operators, including inside calc(), produces CSS that looks identical to a human skimming it but silently fails to parse in the browser. This tool specifically protects calc() expressions (and, more generally, anything inside parentheses reached through url() and quoted strings) from that kind of whitespace stripping.
Why some whitespace is left alone on purpose#
This tool removes spaces immediately around {, }, ;, , and : — always safe, since CSS syntax never depends on whitespace at those positions. It deliberately leaves spaces around combinators (>, +, ~) untouched rather than risk the ambiguity of stripping them in every context; the byte savings from that additional stripping are small, and getting it wrong even occasionally is a worse trade than a slightly larger file.
What never gets touched at all#
Content inside a quoted string (content: "a { b }") and inside url(...) is copied through byte-for-byte, including any characters that would otherwise look like CSS syntax — a brace, a colon, a comment-opening sequence. Minifying the inside of a string or URL would change what the CSS actually renders, not just how it is written.