Socket
Socket
Sign inDemoInstall

colorguard

Package Overview
Dependencies
24
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.1 to 1.2.0

4

CHANGELOG.md
# CSS COLORGUARD CHANGELOG
## 2016-04-30 - 1.2.0
- Added `allowEquivalentNotation` option
## 2016-03-15 - 1.1.1

@@ -4,0 +8,0 @@

@@ -39,2 +39,4 @@ var assign = require('object-assign');

var stripUrl = /url\(['|"]?.*?['|"]?\)/;
var colorguard = postcss.plugin('css-colorguard', function (opts) {

@@ -61,3 +63,4 @@ opts = assign({

css.walkDecls(function (decl) {
var matches = pipetteur(decl.value);
var cleanValue = decl.value.replace(stripUrl, '');
var matches = pipetteur(cleanValue);
matches.forEach(function (match) {

@@ -85,2 +88,8 @@ // FIXME: This discards alpha channel

// If colors are the same (no diff) but have a different representation
// (e.g. #000 and #000000 and black), do not complain
if (opts.allowEquivalentNotation && diffAmount === 0) {
return;
}
var whitelisted = getWhitelistHashKey([color, name]);

@@ -87,0 +96,0 @@ if (diffAmount < opts.threshold && !whitelistHash[whitelisted]) {

2

package.json
{
"name": "colorguard",
"version": "1.1.1",
"version": "1.2.0",
"description": "Keep a watchful eye on your css colors",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -62,2 +62,11 @@ [![Build Status](https://travis-ci.org/SlexAxton/css-colorguard.svg?branch=master)](https://travis-ci.org/SlexAxton/css-colorguard)

##### allowEquivalentNotation
Type: `boolean`
Default: `false`
By default, colorguard will complain if identical colors are represented with different notations.
For example, `#000`, `#000000`, `rgba(0, 0, 0, 0), and `black`. If you want to permit these
equivalent notations, set this option to `true`.
### `postcss([ colorguard(opts) ])`

@@ -64,0 +73,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc