微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

CSS Colorguard

程序名称:CSS Colorguard

授权协议: Apache

操作系统: 跨平台

开发语言: JavaScript

CSS Colorguard 介绍

CSS Colorguard 是一个 Node.js 扩展,用来分析CSS并标出不必要的接近的颜色值冗余

示例代码

var colorguard = require('colorguard');
var fs = require('fs');

var css = fs.readFileSync('./file.css', 'utf8');

var output = colorguard.inspect(css, {
  // 0 through 100. Lower is more similar. Anything below 3 warns you.
  // 3 is the default threshold, but that's mostly personal opinion
  threshold: 3,

  // This color is just ignored entirely (use with caution)
  ignore: ["#030303"],

  // These color combinations are ignored (usually use this)
  whitelist: [["#000000", "#010101"]]
});

CSS Colorguard 官网

https://github.com/SlexAxton/css-colorguard

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐