postcss-colormin 1.2.3 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/index.js +14 -9
  3. package/package.json +6 -9
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ # 1.2.7
2
+
3
+ * Fixes an issue where IE filter properties were being converted
4
+ erroneously (thanks to @faddee).
5
+
6
+ # 1.2.6
7
+
8
+ * Fixed a crash when specifying `inherit` as a value
9
+ to `-webkit-tap-highlight-color`.
10
+
11
+ # 1.2.5
12
+
13
+ * Speed up node iteration by calling `eachDecl` once rather than twice.
14
+
15
+ # 1.2.4
16
+
17
+ * Fixed an issue caused by upgrading colormin to use ES6.
18
+
1
19
  # 1.2.3
2
20
 
3
21
  * Fixed an issue where `-webkit-tap-highlight-color` was being incorrectly
package/index.js CHANGED
@@ -5,7 +5,7 @@ var postcss = require('postcss');
5
5
  var list = postcss.list;
6
6
  var reduce = require('reduce-function-call');
7
7
  var color = require('color');
8
- var trim = require('colormin/lib/stripWhitespace');
8
+ var trim = require('colormin/dist/lib/stripWhitespace');
9
9
 
10
10
  function eachVal (values) {
11
11
  return list.comma(values).map(function (value) {
@@ -15,14 +15,19 @@ function eachVal (values) {
15
15
 
16
16
  module.exports = postcss.plugin('postcss-colormin', function () {
17
17
  return function (css) {
18
- css.eachDecl(/^(?!font|-webkit-tap-highlight-color)/, function (decl) {
19
- decl.value = eachVal(decl.value);
20
- decl.value = reduce(decl.value, 'gradient', function (body, fn) {
21
- return fn + '(' + list.comma(body).map(eachVal).join(',') + ')';
22
- });
23
- });
24
- css.eachDecl('-webkit-tap-highlight-color', function (decl) {
25
- decl.value = trim(color(decl.value).rgbString());
18
+ css.eachDecl(function (decl) {
19
+ if (/^(?!font|filter|-webkit-tap-highlight-color)/.test(decl.prop)) {
20
+ decl.value = eachVal(decl.value);
21
+ decl.value = reduce(decl.value, 'gradient', function (body, fn) {
22
+ return fn + '(' + list.comma(body).map(eachVal).join(',') + ')';
23
+ });
24
+ }
25
+ if (decl.prop === '-webkit-tap-highlight-color') {
26
+ if (decl.value === 'inherit' || decl.value === 'transparent') {
27
+ return;
28
+ }
29
+ decl.value = trim(color(decl.value).rgbString());
30
+ }
26
31
  });
27
32
  };
28
33
  });
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "postcss-colormin",
3
- "version": "1.2.3",
3
+ "version": "1.2.7",
4
4
  "description": "Minify colors in your CSS files with PostCSS and colormin.",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "lint": "jshint index.js --reporter node_modules/jshint-stylish/stylish.js",
8
7
  "test": "tape test.js | tap-spec"
9
8
  },
10
9
  "keywords": [
@@ -18,10 +17,8 @@
18
17
  ],
19
18
  "license": "MIT",
20
19
  "devDependencies": {
21
- "jshint": "^2.6.3",
22
- "jshint-stylish": "^1.0.1",
23
- "tap-spec": "^2.2.2",
24
- "tape": "^3.5.0"
20
+ "tap-spec": "^4.0.2",
21
+ "tape": "^4.0.1"
25
22
  },
26
23
  "homepage": "https://github.com/ben-eb/postcss-colormin",
27
24
  "author": {
@@ -31,9 +28,9 @@
31
28
  },
32
29
  "repository": "ben-eb/postcss-colormin",
33
30
  "dependencies": {
34
- "color": "^0.8.0",
35
- "colormin": "^1.0.1",
36
- "postcss": "^4.1.2",
31
+ "color": "^0.10.1",
32
+ "colormin": "^1.0.3",
33
+ "postcss": "^4.1.16",
37
34
  "reduce-function-call": "^1.0.1"
38
35
  }
39
36
  }