autoprefixer 7.1.6 → 7.2.3
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.
- package/CHANGELOG.md +20 -0
- package/README.md +39 -8
- package/bin/autoprefixer-info +3 -0
- package/data/prefixes.js +1 -1
- package/lib/autoprefixer.js +6 -0
- package/lib/browsers.js +0 -24
- package/lib/declaration.js +5 -5
- package/lib/hacks/animation.js +40 -0
- package/lib/hacks/break-props.js +4 -8
- package/lib/hacks/display-flex.js +2 -4
- package/lib/hacks/filter-value.js +3 -61
- package/lib/hacks/gradient.js +3 -11
- package/lib/hacks/grid-area.js +84 -0
- package/lib/hacks/grid-end.js +3 -3
- package/lib/hacks/grid-row-column.js +60 -0
- package/lib/hacks/grid-rows-columns.js +63 -0
- package/lib/hacks/grid-shorthand.js +160 -0
- package/lib/hacks/grid-start.js +6 -49
- package/lib/hacks/grid-template-areas.js +133 -0
- package/lib/hacks/grid-template.js +28 -68
- package/lib/hacks/image-rendering.js +4 -7
- package/lib/hacks/image-set.js +3 -3
- package/lib/hacks/mask-border.js +3 -3
- package/lib/hacks/text-emphasis-position.js +1 -3
- package/lib/hacks/transform-decl.js +1 -1
- package/lib/prefixer.js +3 -5
- package/lib/prefixes.js +5 -1
- package/lib/processor.js +10 -29
- package/lib/resolution.js +1 -7
- package/lib/supports.js +1 -1
- package/lib/transition.js +3 -6
- package/package.json +32 -14
- package/lib/hacks/flex-values.js +0 -56
package/lib/processor.js
CHANGED
|
@@ -76,6 +76,10 @@ var Processor = function () {
|
|
|
76
76
|
if (decl.value.indexOf('radial-gradient') !== -1) {
|
|
77
77
|
if (OLD_RADIAL.test(decl.value)) {
|
|
78
78
|
result.warn('Gradient has outdated direction syntax. ' + 'New syntax is like `closest-side at 0 0` ' + 'instead of `0 0, closest-side`.', { node: decl });
|
|
79
|
+
} else if (/[^-]cover/.test(decl.value)) {
|
|
80
|
+
result.warn('Gradient has outdated direction syntax. ' + 'Replace `cover` to `farthest-corner`.', { node: decl });
|
|
81
|
+
} else if (/[^-]contain/.test(decl.value)) {
|
|
82
|
+
result.warn('Gradient has outdated direction syntax. ' + 'Replace `contain` to `closest-side`.', { node: decl });
|
|
79
83
|
}
|
|
80
84
|
}
|
|
81
85
|
if (decl.prop === 'text-emphasis-position') {
|
|
@@ -92,17 +96,6 @@ var Processor = function () {
|
|
|
92
96
|
}
|
|
93
97
|
}
|
|
94
98
|
|
|
95
|
-
if (_this.prefixes.options.flexbox !== false) {
|
|
96
|
-
if (decl.prop === 'grid-row-end' && decl.value.indexOf('span') === -1) {
|
|
97
|
-
result.warn('IE supports only grid-row-end with span. ' + 'You should add grid: false option to Autoprefixer ' + 'and use some JS grid polyfill for full spec support', { node: decl });
|
|
98
|
-
}
|
|
99
|
-
if (decl.prop === 'grid-row') {
|
|
100
|
-
if (decl.value.indexOf('/') !== -1 && decl.value.indexOf('span') === -1) {
|
|
101
|
-
result.warn('IE supports only grid-row with / and span. ' + 'You should add grid: false option ' + 'to Autoprefixer and use some JS grid polyfill ' + 'for full spec support', { node: decl });
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
99
|
var prefixer = void 0;
|
|
107
100
|
|
|
108
101
|
if (decl.prop === 'transition' || decl.prop === 'transition-property') {
|
|
@@ -120,7 +113,7 @@ var Processor = function () {
|
|
|
120
113
|
if (display !== 'flex' && _this.prefixes.options.grid !== false) {
|
|
121
114
|
prefixer = _this.prefixes.add['grid-row-align'];
|
|
122
115
|
if (prefixer && prefixer.prefixes) {
|
|
123
|
-
return prefixer.process(decl);
|
|
116
|
+
return prefixer.process(decl, result);
|
|
124
117
|
}
|
|
125
118
|
}
|
|
126
119
|
} else if (decl.prop === 'justify-self') {
|
|
@@ -129,14 +122,14 @@ var Processor = function () {
|
|
|
129
122
|
if (_display !== 'flex' && _this.prefixes.options.grid !== false) {
|
|
130
123
|
prefixer = _this.prefixes.add['grid-column-align'];
|
|
131
124
|
if (prefixer && prefixer.prefixes) {
|
|
132
|
-
return prefixer.process(decl);
|
|
125
|
+
return prefixer.process(decl, result);
|
|
133
126
|
}
|
|
134
127
|
}
|
|
135
128
|
} else {
|
|
136
129
|
// Properties
|
|
137
130
|
prefixer = _this.prefixes.add[decl.prop];
|
|
138
131
|
if (prefixer && prefixer.prefixes) {
|
|
139
|
-
return prefixer.process(decl);
|
|
132
|
+
return prefixer.process(decl, result);
|
|
140
133
|
}
|
|
141
134
|
}
|
|
142
135
|
|
|
@@ -276,11 +269,6 @@ var Processor = function () {
|
|
|
276
269
|
rule.removeChild(i);
|
|
277
270
|
return;
|
|
278
271
|
}
|
|
279
|
-
|
|
280
|
-
if (checker.clean) {
|
|
281
|
-
checker.clean(decl);
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
272
|
}
|
|
285
273
|
});
|
|
286
274
|
};
|
|
@@ -341,6 +329,7 @@ var Processor = function () {
|
|
|
341
329
|
|
|
342
330
|
|
|
343
331
|
Processor.prototype.disabled = function disabled(node, result) {
|
|
332
|
+
if (!node) return false;
|
|
344
333
|
if (node._autoprefixerDisabled !== undefined) {
|
|
345
334
|
return node._autoprefixerDisabled;
|
|
346
335
|
}
|
|
@@ -348,9 +337,7 @@ var Processor = function () {
|
|
|
348
337
|
if (node.nodes) {
|
|
349
338
|
var status = undefined;
|
|
350
339
|
node.each(function (i) {
|
|
351
|
-
if (i.type !== 'comment')
|
|
352
|
-
return undefined;
|
|
353
|
-
}
|
|
340
|
+
if (i.type !== 'comment') return;
|
|
354
341
|
if (/(!\s*)?autoprefixer:\s*(off|on)/i.test(i.text)) {
|
|
355
342
|
if (typeof status !== 'undefined') {
|
|
356
343
|
result.warn('Second Autoprefixer control comment ' + 'was ignored. Autoprefixer applies control ' + 'comment to whole block, not to next rules.', { node: i });
|
|
@@ -358,7 +345,6 @@ var Processor = function () {
|
|
|
358
345
|
status = /on/i.test(i.text);
|
|
359
346
|
}
|
|
360
347
|
}
|
|
361
|
-
return undefined;
|
|
362
348
|
});
|
|
363
349
|
|
|
364
350
|
var value = false;
|
|
@@ -370,15 +356,10 @@ var Processor = function () {
|
|
|
370
356
|
|
|
371
357
|
node._autoprefixerDisabled = value;
|
|
372
358
|
return node._autoprefixerDisabled;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
if (node.parent) {
|
|
359
|
+
} else {
|
|
376
360
|
node._autoprefixerDisabled = this.disabled(node.parent, result);
|
|
377
361
|
return node._autoprefixerDisabled;
|
|
378
362
|
}
|
|
379
|
-
|
|
380
|
-
// unknown state
|
|
381
|
-
return false;
|
|
382
363
|
};
|
|
383
364
|
|
|
384
365
|
/**
|
package/lib/resolution.js
CHANGED
|
@@ -116,10 +116,6 @@ var Resolution = function (_Prefixer) {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
var _loop = function _loop(prefix) {
|
|
119
|
-
if (prefix === '-moz-' && rule.params.indexOf('dpi') !== -1) {
|
|
120
|
-
return 'continue';
|
|
121
|
-
}
|
|
122
|
-
|
|
123
119
|
var processed = query.replace(regexp, function (str) {
|
|
124
120
|
var parts = str.match(split);
|
|
125
121
|
return _this3.prefixQuery(prefix, parts[1], parts[2], parts[3], parts[4]);
|
|
@@ -141,9 +137,7 @@ var Resolution = function (_Prefixer) {
|
|
|
141
137
|
|
|
142
138
|
var prefix = _ref3;
|
|
143
139
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
if (_ret === 'continue') continue;
|
|
140
|
+
_loop(prefix);
|
|
147
141
|
}
|
|
148
142
|
prefixed.push(query);
|
|
149
143
|
}
|
package/lib/supports.js
CHANGED
|
@@ -352,7 +352,7 @@ var Supports = function () {
|
|
|
352
352
|
|
|
353
353
|
|
|
354
354
|
Supports.prototype.disabled = function disabled(node) {
|
|
355
|
-
if (this.all.options.grid
|
|
355
|
+
if (!this.all.options.grid) {
|
|
356
356
|
if (node.prop === 'display' && node.value.indexOf('grid') !== -1) {
|
|
357
357
|
return true;
|
|
358
358
|
}
|
package/lib/transition.js
CHANGED
|
@@ -58,13 +58,10 @@ var Transition = function () {
|
|
|
58
58
|
var param = _ref;
|
|
59
59
|
|
|
60
60
|
prop = this.findProp(param);
|
|
61
|
-
if (prop[0] === '-')
|
|
62
|
-
|
|
63
|
-
}
|
|
61
|
+
if (prop[0] === '-') continue;
|
|
62
|
+
|
|
64
63
|
var prefixer = this.prefixes.add[prop];
|
|
65
|
-
if (!prefixer || !prefixer.prefixes)
|
|
66
|
-
continue;
|
|
67
|
-
}
|
|
64
|
+
if (!prefixer || !prefixer.prefixes) continue;
|
|
68
65
|
|
|
69
66
|
for (var _iterator3 = prefixer.prefixes, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
|
|
70
67
|
if (_isArray3) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autoprefixer",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.3",
|
|
4
4
|
"description": "Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"autoprefixer",
|
|
@@ -13,38 +13,43 @@
|
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"repository": "postcss/autoprefixer",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"browserslist": "^2.
|
|
17
|
-
"caniuse-lite": "^1.0.
|
|
16
|
+
"browserslist": "^2.10.0",
|
|
17
|
+
"caniuse-lite": "^1.0.30000783",
|
|
18
18
|
"normalize-range": "^0.1.2",
|
|
19
19
|
"num2fraction": "^1.2.2",
|
|
20
|
-
"postcss": "^6.0.
|
|
20
|
+
"postcss": "^6.0.14",
|
|
21
21
|
"postcss-value-parser": "^3.2.3"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"babel-
|
|
24
|
+
"babel-core": "^6.26.0",
|
|
25
|
+
"babel-eslint": "^8.0.3",
|
|
25
26
|
"babel-plugin-transform-class-properties": "^6.24.1",
|
|
26
27
|
"babel-preset-env": "^1.6.1",
|
|
27
|
-
"babelify": "^
|
|
28
|
+
"babelify": "^8.0.0",
|
|
28
29
|
"browserify": "^14.5.0",
|
|
29
|
-
"eslint": "^4.
|
|
30
|
+
"eslint": "^4.13.1",
|
|
31
|
+
"eslint-ci": "^0.1.1",
|
|
30
32
|
"eslint-config-postcss": "^2.0.2",
|
|
31
|
-
"fs-extra": "^
|
|
33
|
+
"fs-extra": "^5.0.0",
|
|
32
34
|
"gulp": "^3.9.1",
|
|
33
35
|
"gulp-babel": "^7.0.0",
|
|
34
|
-
"gulp-coffee": "^2.3.
|
|
36
|
+
"gulp-coffee": "^2.3.5",
|
|
35
37
|
"gulp-json-editor": "^2.2.1",
|
|
36
38
|
"gulp-replace": "^0.6.1",
|
|
37
39
|
"jest": "^21.2.1",
|
|
38
|
-
"lint-staged": "^
|
|
40
|
+
"lint-staged": "^6.0.0",
|
|
39
41
|
"pre-commit": "^1.2.2",
|
|
40
|
-
"size-limit": "^0.
|
|
42
|
+
"size-limit": "^0.13.2",
|
|
41
43
|
"vinyl-source-stream": "^1.1.0",
|
|
42
44
|
"babel-register": "^6.26.0"
|
|
43
45
|
},
|
|
46
|
+
"bin": {
|
|
47
|
+
"autoprefixer-info": "./bin/autoprefixer-info"
|
|
48
|
+
},
|
|
44
49
|
"scripts": {
|
|
45
50
|
"lint-staged": "lint-staged",
|
|
46
|
-
"lint": "eslint *.js lib/*.js data/*.js test/*.js",
|
|
47
|
-
"test": "jest && npm run lint && gulp && size-limit"
|
|
51
|
+
"lint": "eslint-ci *.js lib/*.js data/*.js test/*.js",
|
|
52
|
+
"test": "jest --coverage && npm run lint && gulp && size-limit"
|
|
48
53
|
},
|
|
49
54
|
"lint-staged": {
|
|
50
55
|
"*.js": "eslint"
|
|
@@ -54,7 +59,7 @@
|
|
|
54
59
|
],
|
|
55
60
|
"size-limit": [{
|
|
56
61
|
"path": "build/lib/autoprefixer.js",
|
|
57
|
-
"limit": "
|
|
62
|
+
"limit": "250 KB"
|
|
58
63
|
}],
|
|
59
64
|
"eslintConfig": {
|
|
60
65
|
"extends": "eslint-config-postcss",
|
|
@@ -67,6 +72,19 @@
|
|
|
67
72
|
"jest": true
|
|
68
73
|
}
|
|
69
74
|
},
|
|
75
|
+
"jest": {
|
|
76
|
+
"coverageThreshold": {
|
|
77
|
+
"global": {
|
|
78
|
+
"lines": 100
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"modulePathIgnorePatterns": [
|
|
82
|
+
"build/"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"browserslist": [
|
|
86
|
+
"last 1 edge version"
|
|
87
|
+
],
|
|
70
88
|
"babel": {
|
|
71
89
|
"presets": [
|
|
72
90
|
[
|
package/lib/hacks/flex-values.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
-
|
|
5
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
6
|
-
|
|
7
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
8
|
-
|
|
9
|
-
var OldValue = require('../old-value');
|
|
10
|
-
var Value = require('../value');
|
|
11
|
-
|
|
12
|
-
var FlexValues = function (_Value) {
|
|
13
|
-
_inherits(FlexValues, _Value);
|
|
14
|
-
|
|
15
|
-
function FlexValues() {
|
|
16
|
-
_classCallCheck(this, FlexValues);
|
|
17
|
-
|
|
18
|
-
return _possibleConstructorReturn(this, _Value.apply(this, arguments));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Return prefixed property name
|
|
23
|
-
*/
|
|
24
|
-
FlexValues.prototype.prefixed = function prefixed(prefix) {
|
|
25
|
-
return this.all.prefixed(this.name, prefix);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Change property name to prefixed property name
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
FlexValues.prototype.replace = function replace(string, prefix) {
|
|
34
|
-
return string.replace(this.regexp(), '$1' + this.prefixed(prefix) + '$3');
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Return function to fast prefixed property name
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
FlexValues.prototype.old = function old(prefix) {
|
|
43
|
-
return new OldValue(this.name, this.prefixed(prefix));
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
return FlexValues;
|
|
47
|
-
}(Value);
|
|
48
|
-
|
|
49
|
-
Object.defineProperty(FlexValues, 'names', {
|
|
50
|
-
enumerable: true,
|
|
51
|
-
writable: true,
|
|
52
|
-
value: ['flex', 'flex-grow', 'flex-shrink', 'flex-basis']
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
module.exports = FlexValues;
|