Reduce CSS file size by removing whitespace and comments. How to approach CSS minification with Bagiqo tools.
Minified CSS drops the spaces, line breaks and comments a writer uses, leaving the smallest file that still applies the same styles. Smaller CSS means faster downloads.
While Bagiqo has an HTML minifier, the same principle applies to CSS: keep an indented source for editing and serve a condensed version in production.
Why minify CSS
- Less data to transfer on every page load.
- Faster to parse when the browser builds styles.
- Standard practice in modern build tools.
Good workflow
- Keep a readable source file.
- Minify in your build step.
- Combine with minified HTML and JS.
For HTML, use the HTML minifier directly.