CSSTIDY(1) | CSSTIDY(1) |
csstidy - CSS parser and optimiser
csstidy input-file [options] [output-file]
The csstidy(1) command parses and optimises a css file given as input-file. If no output-file is specified, the results are displayed to standard output. Various options allow for fine-grained control over the level of readability, file size and other items.
If you use the filename "-", csstidy reads from stdin. In most case you will probably find that csstidy defaults are reasonable and applicable to most situations.
Note that csstidy is not designed to be a css validator. Although you should only enter valid (or rather well-formed) code, csstidy will also parse and fix incorrect code.
To optimise a CSS file and send the output to screen use:
If you want to save the output to a file, use:
If you want to use an option[s] and output to a file, use:
--allow_html_in_templates=[false|true]
--case_properties=[false|true]
--compress_colors=[true|false]
--compress_font-weight=[true|false]
--discard_invalid_properties=[false|true]
--lowercase_s=[false|true]
--preserve_css=[false|true]
--remove_bslash=[true|false]
--remove_last_;=[false|true]
--silent=[false|true]
--sort_properties=[false|true]
--sort_selectors=[false|true]
--timestamp=[false|true]
--merge_selectors=[2|1|0]
--optimise_shorthands=[1|2|0]
--template=[default|filename|low|high|highest]
The following is a list of all CSS hacks that will not be modified by default by csstidy. If you enable "preserve CSS", more hacks will be saved. In general you should do without CSS hacks anyway, but if you need them and want to use csstidy you should use one of the following hacks:
p\roperty:value; (only if you disable the removal of unnecessary backslashes) div#test head:first-child+body div body>div html[xmlns] div @import "null?\"\\{"; @import "styles.css"; (and all other @import rules) @media all{/\* rules \*/} * html div i\{content:"\"/*"\} div\{property:value\} html*#test _property:value
Written by Florian Schmitz <floele@gmail.com>
Main web site: http://csstidy.sourceforge.net/
This manual page was written by Kevin Coyner <kcoyner@debian.org> for the Debian project but may be used by others.
03/18/2007 |