Minified CSS etiquette

Written on 19 June, 2012

Minifying CSS should always be encouraged. To simply summarise, it’ll reduce the size of your CSS files and improve the loading times of your website (albeit minimally in certain cases, but every little helps).

However, it does render it pretty much unreadable to the human eye (unless they make the effort of manually putting it through a de-minifier first).

Minified CSS

Minified CSS isn't known for being the most human friendly…

Inspecting other people’s code is known to be one of the best ways to learn web development and improve your overall knowledge and skill-set, and unreadable code kind of hinders that.

So, my proposed etiquette (that I’m sure plenty of you have already put in practice) is the following:

Simply include your minified CSS, and then include a commented out link to the original CSS file/s (or LESS/SASS if you’re a fan of pre-processors). The actual page renders with the minified CSS with the smaller file size, while you’re providing a human friendly version for anyone inspecting your code (without the webpage trying to download it).

No excuses for hiding behind your minified CSS now…

Want updates?

Get an email each time I write about design and tech. Zero spam. Or, follow me on Twitter.