This script is formats css files even if they are compressed and/or minified.
It uses standard UNIX utilities to make its work:
- POSIX sed
- Perl (5.8 or later)
- GNU gzip (if you want to uncompress gzipped CSS files, recommended)
- BZip2 (if you want to uncompress CSS files compressed by BZip2, not needed)
- XZ (f you want to uncompress CSS files compressed by XZ/LZMA, not needed)
The script supports to ways of usage. First is formatting a file:
csspp jquery.ui.jquery.ui.selectable.css
It converts this:
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
To this:
.ui-selectable-helper {
position: absolute;
z-index: 100;
border: 1px dotted black;
}
The second usage is pipelining the source directly from internet:
curl -ks http://foobar.com/css/jquery.ui.selectable.css | csspp
The example is taken from jQuery UI 1.9.1
To install this script, simply clone this gist repo, and copy the file somewhere on your path. Do not forget adding executable bit to the file.
This script is not designed to be bullet-proof thus it does not check existence of used tools. It assumes you have installed tools, however, these tools are installed on a normal Unix/Linux desktop, so you do not need to do anything for prerequisites.
This script is licensed under the terms of CreativeCommons Attribution-ShareAlike 3.0 license. To read the full license, visit its own homepage.
Copyright (C) 2011-2012 Gabor Garami. Some rights reserved.