CSSColorguard是一个Node.js扩展,用来分析CSS并标出不必要的接近的颜色值冗余
示例代码:
var colorguard = require('colorguard');var fs = require('fs');var css = fs.readFileSyc('./file.css', 'utf8');var output = colorguard.ispect(css, { // 0 through 100. Lower is more similar. Aythig below 3 wars you. // 3 is the default threshold, but that's mostly persoal opiio threshold: 3, // This color is just igored etirely (use with cautio) igore: ["#030303"], // These color combiatios are igored (usually use this) whitelist: [["#000000", "#010101"]]});
评论