818
Du
dustymarkdown / files
dustymarkdown / node_modules / sqwish / README.md
1.4 KB
1Welcome to Sqwish 2---------- 3A [Node](http://nodejs.org) based CSS Compressor. It works like this. 4 5 require('sqwish').minify('body { color: #ff33cc; }'); 6 // => 7 body{color:#f3c} 8 9CLI 10--- 11Install it. 12 13 $ npm install sqwish 14 15Use it like this: 16 17 $ sqwish app.css # default output is <file>.min.css therefore app.css => app.min.css 18 $ # or... 19 $ sqwish css/styles.css -o prod/something-else.min.css 20 21Notes 22------- 23Sqwish does not attempt to fix invalid CSS, therefore, at minimum, your CSS should at least follow the basic rules: 24 25 selectors[,more selectors] { 26 property: value; 27 another-property: another value; 28 } 29 30Strict Optimizations 31---------- 32Aside from regular minification, in <code>--strict</code> mode Sqwish will combine duplicate selectors and merge duplicate properties. 33 34``` css 35/* before */ 36div { 37 color: orange; 38 background: red; 39} 40div { 41 color: #ff33cc; 42 margin: 1px 0px 1px 0px; 43} 44 45/* after */ 46div{color:#f3c;background:red;margin:1px 0} 47``` 48 49This mode can be enabled as so: 50 51 sqwish.minify(css, true); 52 53on the command line 54 55 $ sqwish styles.css --strict 56 57Developers 58---------- 59Be sure you have the proper testing harness set up ahead of time by installing the <code>sink-test</code> submodule 60 61 $ npm install --dev 62 63Tests can be added in <code>tests/tests.js</code>, and then run as such: 64 65 $ npm test 66 67License 68------- 69Sqwish is copyright Dustin Diaz 2011 under MIT License 70 71**Happy Sqwishing!**