uglifycss

UglifyCSS is a port of YUI Compressor to NodeJS for its CSS part. Its name is a reference to the awesome UglifyJS but UglifyCSS is not a CSS parser. Like YUI CSS Compressor, it applies many regexp replacements. Note that a port to JavaScript is also available in the YUI Compressor repository.

UglifyCSS passes successfully the test suite of YUI compressor CSS.

Be sure to submit valid CSS to UglifyCSS or you could get weird results.

Installation

For a command line usage:

$ npm install uglifycss -g

For API usage:

$ npm install uglifycss

From Github:

$ git clone git://github.com/fmarcia/UglifyCSS.git

Command line

$ uglifycss [options] [filename] [...] > output

Options:

--max-line-len n adds a newline (approx.) every n characters; 0 means no newline and is the default value

--expand-vars expands variables; by default, @variables blocks are preserved and var(x)s are not expanded