php - How can I validate CSS within a script? -


is there library out there validate css?

the tools can find web sites. if 1 of these sites has api, fit bill, too.

i have script serves css compiler. sets various variables according settings theme, , generates , writes css file. before committing writing css file, i'd validate make sure there aren't invalid entries.

php convenient, python, perl, ruby, java, or executable shell fine.

ideally, there's out there can use part of sequence like:

 $css_file=theme_compile('theme-name');  if(!validate_css($css_file)){    echo "css file contained invalid entry 'width:px'";//just example, of course    }     else{    file_put_contents('/path/css_file',$css_file);    } 

w3c has api:

http://jigsaw.w3.org/css-validator/api.html

you can download validator , run locally: http://jigsaw.w3.org/css-validator/download.html

you need able run java script.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -