css- colorguard 介绍
每 一个 css 项目开始时愿望都是很美好的,但不可避免地,多人协作的项目相互之间可能重复使用了相似的颜色,而你从来不知道它们的存在。css Colorguard 帮助您保持您想要的颜色设置,当你 添加 的颜色和那些已经存在的颜色相似的时候 提示 你。当然,它的所有配置都可以自由定制。另外,css Colorguard 还提供了 Gulp 和 Grunt 插件 。
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 ig nor ed entirely (use with caution)
ig nor e: ["#030303"],
// These color combinations are ig nor ed (usually use this)
whitelist: [["#000000","#010101"]]
});
GitHub: https://github.com/SlexAxton/css-colorguard
网站描述: 避免使用重复的颜色
css-colorguard官方网站
官方网站:
如果觉得 网站内容还不错,欢迎将 网站 推荐给程序员好友。