The W3 CSS validator is pretty simple to install locally for use behind the firewall.
However, by default the validator spits out the whole CSS file after validation, which is inconvenient if your stylesheet is more than a few lines long.
Unfortunately it's not so obvious how to configure the validator to give pretty-printed, human-readable output. In fact, all there is to it, is to choose a different output format from the several that are supported :)
By default the validator .jar file gives you "text" output, which includes the stylesheet. To choose a different format, invoke the validator .jar file with an -output argument, like this:
java -jar css-validator.jar -output <FORMAT> local-file:foo.css
<FORMAT> is any of xhtml, xml, text, soap12, json, ucn or gnu
If you just want the errors as (html-escaped) plain text, but without the CSS included, use
- java -jar css-validator.jar -output gnu local-file:foo.css
- java -jar css-validator.jar -output json http://onemorebug.com/css/index.css
You need to login to post a comment.