{ datagubbe }

datagubbe.se » mincss - CSS Minifier

mincss - CSS Minifier

mincss is a small CSS minifier written as a POSIX compliant shell script.

The CSS on this site has been minified with mincss. Feel free to compare the files before minification and after minification.


From a terminal:
mincss input-file [output-file]



I got the idea that I wanted to minify my (already small) CSS for this site, and figured a small command line tool would do the job. Alas, all the command line tools I could find in the regular places (and without overstretching my google-fu) required some combination of Python or Node.js, which seemed excessive considering I basically just wanted to strip away a few whitespaces here and there.

Needless to say, CSS minification can be a lot more intricate than stripping away spaces using a few rudimentary regular expressions, but for my needs (and for the various stylesheets I've tested with), mincss does the job.