gulp-w3c-css
A Gulp plugin for CSS Validation using W3C CSS Validation Service
Depends on w3c-css package.
Installation
$ npm install gulp-w3c-css
Usage
Validate all *.css
files in the /css
directory and write results to the /build
directory.
If there are no errors or warnings in a file, the resulting file will be empty. Otherwise the file will contain errors and warnings as JSON object:
"errors": /* ... */ "warnings": /* ... */
var validate = ; var path = ;var gulp = ; var srcPath = path;var dstPath = path; gulp ;
OR
var validate = ; var path = ;var gulp = ;var ListStream = ; var srcPath = path; gulp ;
Arguments
The first argument to the validate function can be an options object with the following properties:
sleep
- time to sleep between the requests, milliseconds [default: 1500 -- 1.5 seconds]. This option is required if you intend to validate several CSS files at once. Make sure its value is greater than 1 second. Otherwise, consider using a Private CSS Validator that doesn't have any request-frequency limitations.profile
- the CSS profile used for the validation:css1, css2, css21, css3
[default: 'css3']usermedium
- the medium used for the validation:screen, print, ...
[default: 'all']server
- the "IP:PORT" string or the URL object of a custom validation server, e.g,'172.17.0.2:8080'
or{ host: '172.17.0.2:8080' }
.
Contact
License
Distributed under the The MIT License (MIT).