1.0.0 • Published 9 years ago

beautify-css v1.0.0

Weekly downloads
5
License
CC0
Repository
-
Last release
9 years ago

beautify-css

beautify-css is a command-line CSS beautifier that uses the css npm module to parse and format valid CSS.

You can install it with npm install [-g] beautify-css.

Usage

beautify-css [options] [input] [output]

Options:
  --indent, -i    indent with this number of spaces (or string)    
  --encoding, -e  string encoding (default: "utf8")                
  --compress, -c  compress output, removing whitespace and comments
  --source-map    generate a source map, and write it to this file 
  --source-in     reference one or more input source maps          
  --in-place, -p  modify the input file in place                   
  -v              output helpful debugging messages                

Some examples:

# read from and write to files
beautify-css ugly.css pretty.css

# or you can use the --in-place/-p to overwrite the file
# (remember to back it up or check it in first!)
beautify-css -p style.css

# read ugly css from stdin, write to a filename
echo 'body{margin:0}' | beautify-css - pretty.css
# or redirect stdout to a file
echo 'body{margin:0}' | beautify-css > pretty.css

# pipe pretty css to another tool, such as
# myth: <https://github.com/segmentio/myth>
echo 'body{margin:0}' | beautify-css | myth > beautiful.css