I own and run a digital agency called Red Wolf Digital, for the most part my work involves building websites. We use an in-house content management system we call Mercury to build most of the sites we produce for clients. One of the things I’ve been trying to find for some time was a way to automatically minify the CSS used to style these sites.
There are loads of CSS and JavaScript minifiers out there, but I was struggling to find one that would handle @import
statements. I’m a great believer in object orientated coding principles and the benefits afforded to you by breaking large, monolithic entities into smaller more manageable chunks. Something that was kept in mind whilst designing and developing Mercury, which of course, makes full use of CSS @import
rules. The lack of a minifier that will handle this has prompted me to write a small script to do it for me, I include it here should anyone happen across it and get some use from it.