Skip to content
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.
/ uglifycss Public archive

Port of YUI CSS Compressor from Java to NodeJS

License

Notifications You must be signed in to change notification settings

fmarcia/uglifycss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UglifyCSS is a port of YUI Compressor, for its CSS part, from Java to NodeJS. Its name is a reference to the awesome UglifyJS but UglifyCSS is not a CSS parser. Like YUI CSS Compressor, it applies many regex replacements.

Usage: uglifycss [options] css1 [css2] [...] > output

Options:

  • --max-line-len n adds a newline 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
  • --cute-comments preserves newlines within and around preserved comments; by default, newlines are removed from preserved comments

A port to javascript is also available in the YUI Compressor repository.

2 functions are available :

  • processString(content, options)
  • processFiles(filenames, options)

See test.js for example.