autoprefixer 9.3.1 → 9.4.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 +15 -0
- package/README.md +501 -89
- package/lib/at-rule.js +2 -2
- package/lib/browsers.js +6 -6
- package/lib/declaration.js +26 -26
- package/lib/hacks/align-content.js +4 -4
- package/lib/hacks/align-items.js +4 -4
- package/lib/hacks/align-self.js +14 -8
- package/lib/hacks/block-logical.js +2 -2
- package/lib/hacks/border-radius.js +2 -2
- package/lib/hacks/break-props.js +6 -6
- package/lib/hacks/color-adjust.js +2 -2
- package/lib/hacks/display-flex.js +6 -6
- package/lib/hacks/flex-basis.js +4 -4
- package/lib/hacks/flex-direction.js +4 -4
- package/lib/hacks/flex-grow.js +2 -2
- package/lib/hacks/flex-shrink.js +4 -4
- package/lib/hacks/flex.js +4 -4
- package/lib/hacks/gradient.js +32 -32
- package/lib/hacks/grid-column-align.js +4 -4
- package/lib/hacks/grid-row-align.js +4 -4
- package/lib/hacks/grid-rows-columns.js +93 -11
- package/lib/hacks/grid-start.js +4 -4
- package/lib/hacks/grid-template-areas.js +14 -62
- package/lib/hacks/grid-utils.js +129 -3
- package/lib/hacks/image-rendering.js +8 -8
- package/lib/hacks/inline-logical.js +2 -2
- package/lib/hacks/justify-content.js +4 -4
- package/lib/hacks/mask-border.js +2 -2
- package/lib/hacks/order.js +4 -4
- package/lib/hacks/overscroll-behavior.js +4 -4
- package/lib/hacks/pixelated.js +2 -2
- package/lib/hacks/placeholder.js +2 -2
- package/lib/hacks/transform-decl.js +6 -6
- package/lib/old-selector.js +2 -2
- package/lib/prefixer.js +8 -8
- package/lib/prefixes.js +18 -18
- package/lib/processor.js +88 -21
- package/lib/resolution.js +6 -6
- package/lib/selector.js +16 -16
- package/lib/supports.js +30 -30
- package/lib/transition.js +22 -22
- package/lib/value.js +12 -12
- package/package.json +4 -4
|
@@ -24,11 +24,11 @@ function (_Declaration) {
|
|
|
24
24
|
*/
|
|
25
25
|
_proto.check = function check(decl) {
|
|
26
26
|
return decl.value === 'pixelated';
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
28
|
/**
|
|
29
29
|
* Change property name for IE
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
;
|
|
32
32
|
|
|
33
33
|
_proto.prefixed = function prefixed(prop, prefix) {
|
|
34
34
|
if (prefix === '-ms-') {
|
|
@@ -36,30 +36,30 @@ function (_Declaration) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
return _Declaration.prototype.prefixed.call(this, prop, prefix);
|
|
39
|
-
}
|
|
39
|
+
}
|
|
40
40
|
/**
|
|
41
41
|
* Change property and value for IE
|
|
42
42
|
*/
|
|
43
|
-
|
|
43
|
+
;
|
|
44
44
|
|
|
45
45
|
_proto.set = function set(decl, prefix) {
|
|
46
46
|
if (prefix !== '-ms-') return _Declaration.prototype.set.call(this, decl, prefix);
|
|
47
47
|
decl.prop = '-ms-interpolation-mode';
|
|
48
48
|
decl.value = 'nearest-neighbor';
|
|
49
49
|
return decl;
|
|
50
|
-
}
|
|
50
|
+
}
|
|
51
51
|
/**
|
|
52
52
|
* Return property name by spec
|
|
53
53
|
*/
|
|
54
|
-
|
|
54
|
+
;
|
|
55
55
|
|
|
56
56
|
_proto.normalize = function normalize() {
|
|
57
57
|
return 'image-rendering';
|
|
58
|
-
}
|
|
58
|
+
}
|
|
59
59
|
/**
|
|
60
60
|
* Warn on old value
|
|
61
61
|
*/
|
|
62
|
-
|
|
62
|
+
;
|
|
63
63
|
|
|
64
64
|
_proto.process = function process(node, result) {
|
|
65
65
|
return _Declaration.prototype.process.call(this, node, result);
|
|
@@ -24,11 +24,11 @@ function (_Declaration) {
|
|
|
24
24
|
*/
|
|
25
25
|
_proto.prefixed = function prefixed(prop, prefix) {
|
|
26
26
|
return prefix + prop.replace('-inline', '');
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
28
|
/**
|
|
29
29
|
* Return property name by spec
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
;
|
|
32
32
|
|
|
33
33
|
_proto.normalize = function normalize(prop) {
|
|
34
34
|
return prop.replace(/(margin|padding|border)-(start|end)/, '$1-inline-$2');
|
|
@@ -38,19 +38,19 @@ function (_Declaration) {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
return _Declaration.prototype.prefixed.call(this, prop, prefix);
|
|
41
|
-
}
|
|
41
|
+
}
|
|
42
42
|
/**
|
|
43
43
|
* Return property name by final spec
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
;
|
|
46
46
|
|
|
47
47
|
_proto.normalize = function normalize() {
|
|
48
48
|
return 'justify-content';
|
|
49
|
-
}
|
|
49
|
+
}
|
|
50
50
|
/**
|
|
51
51
|
* Change value for 2009 and 2012 specs
|
|
52
52
|
*/
|
|
53
|
-
|
|
53
|
+
;
|
|
54
54
|
|
|
55
55
|
_proto.set = function set(decl, prefix) {
|
|
56
56
|
var spec = flexSpec(prefix)[0];
|
package/lib/hacks/mask-border.js
CHANGED
|
@@ -24,11 +24,11 @@ function (_Declaration) {
|
|
|
24
24
|
*/
|
|
25
25
|
_proto.normalize = function normalize() {
|
|
26
26
|
return this.name.replace('box-image', 'border');
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
28
|
/**
|
|
29
29
|
* Return flex property for 2012 spec
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
;
|
|
32
32
|
|
|
33
33
|
_proto.prefixed = function prefixed(prop, prefix) {
|
|
34
34
|
var result = _Declaration.prototype.prefixed.call(this, prop, prefix);
|
package/lib/hacks/order.js
CHANGED
|
@@ -41,19 +41,19 @@ function (_Declaration) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
return _Declaration.prototype.prefixed.call(this, prop, prefix);
|
|
44
|
-
}
|
|
44
|
+
}
|
|
45
45
|
/**
|
|
46
46
|
* Return property name by final spec
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
;
|
|
49
49
|
|
|
50
50
|
_proto.normalize = function normalize() {
|
|
51
51
|
return 'order';
|
|
52
|
-
}
|
|
52
|
+
}
|
|
53
53
|
/**
|
|
54
54
|
* Fix value for 2009 spec
|
|
55
55
|
*/
|
|
56
|
-
|
|
56
|
+
;
|
|
57
57
|
|
|
58
58
|
_proto.set = function set(decl, prefix) {
|
|
59
59
|
var spec = flexSpec(prefix)[0];
|
|
@@ -24,19 +24,19 @@ function (_Declaration) {
|
|
|
24
24
|
*/
|
|
25
25
|
_proto.prefixed = function prefixed(prop, prefix) {
|
|
26
26
|
return prefix + 'scroll-chaining';
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
28
|
/**
|
|
29
29
|
* Return property name by spec
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
;
|
|
32
32
|
|
|
33
33
|
_proto.normalize = function normalize() {
|
|
34
34
|
return 'overscroll-behavior';
|
|
35
|
-
}
|
|
35
|
+
}
|
|
36
36
|
/**
|
|
37
37
|
* Change value for IE
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
;
|
|
40
40
|
|
|
41
41
|
_proto.set = function set(decl, prefix) {
|
|
42
42
|
if (decl.value === 'auto') {
|
package/lib/hacks/pixelated.js
CHANGED
package/lib/hacks/placeholder.js
CHANGED
|
@@ -24,11 +24,11 @@ function (_Selector) {
|
|
|
24
24
|
*/
|
|
25
25
|
_proto.possible = function possible() {
|
|
26
26
|
return _Selector.prototype.possible.call(this).concat(['-moz- old', '-ms- old']);
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
28
|
/**
|
|
29
29
|
* Return different selectors depend on prefix
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
;
|
|
32
32
|
|
|
33
33
|
_proto.prefixed = function prefixed(prefix) {
|
|
34
34
|
if (prefix === '-webkit-') {
|
|
@@ -35,11 +35,11 @@ function (_Declaration) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
return false;
|
|
38
|
-
}
|
|
38
|
+
}
|
|
39
39
|
/**
|
|
40
40
|
* Is transform contain 3D commands
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
;
|
|
43
43
|
|
|
44
44
|
_proto.contain3d = function contain3d(decl) {
|
|
45
45
|
if (decl.prop === 'transform-origin') {
|
|
@@ -66,11 +66,11 @@ function (_Declaration) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
return false;
|
|
69
|
-
}
|
|
69
|
+
}
|
|
70
70
|
/**
|
|
71
71
|
* Replace rotateZ to rotate for IE 9
|
|
72
72
|
*/
|
|
73
|
-
|
|
73
|
+
;
|
|
74
74
|
|
|
75
75
|
_proto.set = function set(decl, prefix) {
|
|
76
76
|
decl = _Declaration.prototype.set.call(this, decl, prefix);
|
|
@@ -80,11 +80,11 @@ function (_Declaration) {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
return decl;
|
|
83
|
-
}
|
|
83
|
+
}
|
|
84
84
|
/**
|
|
85
85
|
* Don't add prefix for IE in keyframes
|
|
86
86
|
*/
|
|
87
|
-
|
|
87
|
+
;
|
|
88
88
|
|
|
89
89
|
_proto.insert = function insert(decl, prefix, prefixes) {
|
|
90
90
|
if (prefix === '-ms-') {
|
package/lib/old-selector.js
CHANGED
package/lib/prefixer.js
CHANGED
|
@@ -58,11 +58,11 @@ function () {
|
|
|
58
58
|
_this.hacks[name] = klass;
|
|
59
59
|
return _this.hacks[name];
|
|
60
60
|
});
|
|
61
|
-
}
|
|
61
|
+
}
|
|
62
62
|
/**
|
|
63
63
|
* Load hacks for some names
|
|
64
64
|
*/
|
|
65
|
-
|
|
65
|
+
;
|
|
66
66
|
|
|
67
67
|
Prefixer.load = function load(name, prefixes, all) {
|
|
68
68
|
var Klass = this.hacks && this.hacks[name];
|
|
@@ -72,11 +72,11 @@ function () {
|
|
|
72
72
|
} else {
|
|
73
73
|
return new this(name, prefixes, all);
|
|
74
74
|
}
|
|
75
|
-
}
|
|
75
|
+
}
|
|
76
76
|
/**
|
|
77
77
|
* Clone node and clean autprefixer custom caches
|
|
78
78
|
*/
|
|
79
|
-
|
|
79
|
+
;
|
|
80
80
|
|
|
81
81
|
Prefixer.clone = function clone(node, overrides) {
|
|
82
82
|
var cloned = _clone(node);
|
|
@@ -123,11 +123,11 @@ function () {
|
|
|
123
123
|
|
|
124
124
|
node._autoprefixerPrefix = prefix;
|
|
125
125
|
return node._autoprefixerPrefix;
|
|
126
|
-
}
|
|
126
|
+
}
|
|
127
127
|
/**
|
|
128
128
|
* Clone node with prefixes
|
|
129
129
|
*/
|
|
130
|
-
|
|
130
|
+
;
|
|
131
131
|
|
|
132
132
|
_proto.process = function process(node, result) {
|
|
133
133
|
if (!this.check(node)) {
|
|
@@ -160,11 +160,11 @@ function () {
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
return added;
|
|
163
|
-
}
|
|
163
|
+
}
|
|
164
164
|
/**
|
|
165
165
|
* Shortcut for Prefixer.clone
|
|
166
166
|
*/
|
|
167
|
-
|
|
167
|
+
;
|
|
168
168
|
|
|
169
169
|
_proto.clone = function clone(node, overrides) {
|
|
170
170
|
return Prefixer.clone(node, overrides);
|
package/lib/prefixes.js
CHANGED
|
@@ -113,11 +113,11 @@ function () {
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
return this.cleanerCache;
|
|
116
|
-
}
|
|
116
|
+
}
|
|
117
117
|
/**
|
|
118
118
|
* Select prefixes from data, which is necessary for selected browsers
|
|
119
119
|
*/
|
|
120
|
-
|
|
120
|
+
;
|
|
121
121
|
|
|
122
122
|
_proto.select = function select(list) {
|
|
123
123
|
var _this = this;
|
|
@@ -190,11 +190,11 @@ function () {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
return selected;
|
|
193
|
-
}
|
|
193
|
+
}
|
|
194
194
|
/**
|
|
195
195
|
* Sort vendor prefixes
|
|
196
196
|
*/
|
|
197
|
-
|
|
197
|
+
;
|
|
198
198
|
|
|
199
199
|
_proto.sort = function sort(prefixes) {
|
|
200
200
|
return prefixes.sort(function (a, b) {
|
|
@@ -207,11 +207,11 @@ function () {
|
|
|
207
207
|
return bLength - aLength;
|
|
208
208
|
}
|
|
209
209
|
});
|
|
210
|
-
}
|
|
210
|
+
}
|
|
211
211
|
/**
|
|
212
212
|
* Cache prefixes data to fast CSS processing
|
|
213
213
|
*/
|
|
214
|
-
|
|
214
|
+
;
|
|
215
215
|
|
|
216
216
|
_proto.preprocess = function preprocess(selected) {
|
|
217
217
|
var add = {
|
|
@@ -415,11 +415,11 @@ function () {
|
|
|
415
415
|
}
|
|
416
416
|
|
|
417
417
|
return [add, remove];
|
|
418
|
-
}
|
|
418
|
+
}
|
|
419
419
|
/**
|
|
420
420
|
* Declaration loader with caching
|
|
421
421
|
*/
|
|
422
|
-
|
|
422
|
+
;
|
|
423
423
|
|
|
424
424
|
_proto.decl = function decl(prop) {
|
|
425
425
|
var decl = declsCache[prop];
|
|
@@ -430,11 +430,11 @@ function () {
|
|
|
430
430
|
declsCache[prop] = Declaration.load(prop);
|
|
431
431
|
return declsCache[prop];
|
|
432
432
|
}
|
|
433
|
-
}
|
|
433
|
+
}
|
|
434
434
|
/**
|
|
435
435
|
* Return unprefixed version of property
|
|
436
436
|
*/
|
|
437
|
-
|
|
437
|
+
;
|
|
438
438
|
|
|
439
439
|
_proto.unprefixed = function unprefixed(prop) {
|
|
440
440
|
var value = this.normalize(vendor.unprefixed(prop));
|
|
@@ -444,28 +444,28 @@ function () {
|
|
|
444
444
|
}
|
|
445
445
|
|
|
446
446
|
return value;
|
|
447
|
-
}
|
|
447
|
+
}
|
|
448
448
|
/**
|
|
449
449
|
* Normalize prefix for remover
|
|
450
450
|
*/
|
|
451
|
-
|
|
451
|
+
;
|
|
452
452
|
|
|
453
453
|
_proto.normalize = function normalize(prop) {
|
|
454
454
|
return this.decl(prop).normalize(prop);
|
|
455
|
-
}
|
|
455
|
+
}
|
|
456
456
|
/**
|
|
457
457
|
* Return prefixed version of property
|
|
458
458
|
*/
|
|
459
|
-
|
|
459
|
+
;
|
|
460
460
|
|
|
461
461
|
_proto.prefixed = function prefixed(prop, prefix) {
|
|
462
462
|
prop = vendor.unprefixed(prop);
|
|
463
463
|
return this.decl(prop).prefixed(prop, prefix);
|
|
464
|
-
}
|
|
464
|
+
}
|
|
465
465
|
/**
|
|
466
466
|
* Return values, which must be prefixed in selected property
|
|
467
467
|
*/
|
|
468
|
-
|
|
468
|
+
;
|
|
469
469
|
|
|
470
470
|
_proto.values = function values(type, prop) {
|
|
471
471
|
var data = this[type];
|
|
@@ -477,11 +477,11 @@ function () {
|
|
|
477
477
|
} else {
|
|
478
478
|
return global || values || [];
|
|
479
479
|
}
|
|
480
|
-
}
|
|
480
|
+
}
|
|
481
481
|
/**
|
|
482
482
|
* Group declaration by unprefixed property to check them
|
|
483
483
|
*/
|
|
484
|
-
|
|
484
|
+
;
|
|
485
485
|
|
|
486
486
|
_proto.group = function group(decl) {
|
|
487
487
|
var _this2 = this;
|
package/lib/processor.js
CHANGED
|
@@ -8,8 +8,25 @@ var OLD_LINEAR = /(^|[^-])linear-gradient\(\s*(top|left|right|bottom)/i;
|
|
|
8
8
|
var OLD_RADIAL = /(^|[^-])radial-gradient\(\s*\d+(\w*|%)\s+\d+(\w*|%)\s*,/i;
|
|
9
9
|
var RADIAL_BLOCK = /\(((?:[^)(]+|\((?:[^)(]+|\([^)(]*\))*\))*)\)/i;
|
|
10
10
|
var IGNORE_NEXT = /(!\s*)?autoprefixer:\s*ignore\s+next/i;
|
|
11
|
+
var GRID_REGEX = /(!\s*)?autoprefixer\s*grid:\s*(on|off|(no-)?autoplace)/i;
|
|
11
12
|
var SIZES = ['width', 'height', 'min-width', 'max-width', 'min-height', 'max-height', 'inline-size', 'min-inline-size', 'max-inline-size', 'block-size', 'min-block-size', 'max-block-size'];
|
|
12
13
|
|
|
14
|
+
function hasGridTemplate(decl) {
|
|
15
|
+
return decl.parent.some(function (i) {
|
|
16
|
+
return i.prop === 'grid-template' || i.prop === 'grid-template-areas';
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function hasRowsAndColumns(decl) {
|
|
21
|
+
var hasRows = decl.parent.some(function (i) {
|
|
22
|
+
return i.prop === 'grid-template-rows';
|
|
23
|
+
});
|
|
24
|
+
var hasColumns = decl.parent.some(function (i) {
|
|
25
|
+
return i.prop === 'grid-template-columns';
|
|
26
|
+
});
|
|
27
|
+
return hasRows && hasColumns;
|
|
28
|
+
}
|
|
29
|
+
|
|
13
30
|
var Processor =
|
|
14
31
|
/*#__PURE__*/
|
|
15
32
|
function () {
|
|
@@ -69,9 +86,16 @@ function () {
|
|
|
69
86
|
});
|
|
70
87
|
}
|
|
71
88
|
|
|
89
|
+
function insideFlex(decl) {
|
|
90
|
+
return decl.parent.some(function (subDecl) {
|
|
91
|
+
return subDecl.prop === 'display' && /(inline-)?flex/.test(subDecl.value);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
72
95
|
var gridPrefixes = this.gridStatus(css, result) && this.prefixes.add['grid-area'] && this.prefixes.add['grid-area'].prefixes;
|
|
73
96
|
css.walkDecls(function (decl) {
|
|
74
97
|
if (_this.disabledDecl(decl, result)) return undefined;
|
|
98
|
+
var parent = decl.parent;
|
|
75
99
|
var prop = decl.prop;
|
|
76
100
|
var value = decl.value;
|
|
77
101
|
|
|
@@ -96,6 +120,12 @@ function () {
|
|
|
96
120
|
node: decl
|
|
97
121
|
});
|
|
98
122
|
}
|
|
123
|
+
} else if (/^(align|justify|place)-(items|content)$/.test(prop) && insideFlex(decl)) {
|
|
124
|
+
if (value === 'start' || value === 'end') {
|
|
125
|
+
result.warn(value + " value has mixed support, consider using " + ("flex-" + value + " instead"), {
|
|
126
|
+
node: decl
|
|
127
|
+
});
|
|
128
|
+
}
|
|
99
129
|
} else {
|
|
100
130
|
if (gridPrefixes) {
|
|
101
131
|
if (/^(align|justify|place)-items$/.test(prop) && insideGrid(decl)) {
|
|
@@ -112,6 +142,18 @@ function () {
|
|
|
112
142
|
node: decl
|
|
113
143
|
});
|
|
114
144
|
return undefined;
|
|
145
|
+
} else if (decl.prop === 'grid-gap') {
|
|
146
|
+
var status = _this.gridStatus(decl, result);
|
|
147
|
+
|
|
148
|
+
if (status === 'autoplace' && !hasRowsAndColumns(decl) && !hasGridTemplate(decl)) {
|
|
149
|
+
result.warn('grid-gap only works if grid-template(-areas) is being ' + 'used or both rows and columns have been declared ' + 'and cells have not been manually ' + 'placed inside the explicit grid', {
|
|
150
|
+
node: decl
|
|
151
|
+
});
|
|
152
|
+
} else if ((status === true || status === 'no-autoplace') && !hasGridTemplate(decl)) {
|
|
153
|
+
result.warn("grid-gap only works if grid-template(-areas) is being used", {
|
|
154
|
+
node: decl
|
|
155
|
+
});
|
|
156
|
+
}
|
|
115
157
|
} else if (prop === 'grid-auto-columns') {
|
|
116
158
|
result.warn('grid-auto-columns is not supported by IE', {
|
|
117
159
|
node: decl
|
|
@@ -123,9 +165,27 @@ function () {
|
|
|
123
165
|
});
|
|
124
166
|
return undefined;
|
|
125
167
|
} else if (prop === 'grid-auto-flow') {
|
|
126
|
-
|
|
127
|
-
|
|
168
|
+
var hasRows = parent.some(function (i) {
|
|
169
|
+
return i.prop === 'grid-template-rows';
|
|
128
170
|
});
|
|
171
|
+
var hasCols = parent.some(function (i) {
|
|
172
|
+
return i.prop === 'grid-template-columns';
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
if (hasGridTemplate(decl)) {
|
|
176
|
+
result.warn('grid-auto-flow is not supported by IE', {
|
|
177
|
+
node: decl
|
|
178
|
+
});
|
|
179
|
+
} else if (value.includes('dense')) {
|
|
180
|
+
result.warn('grid-auto-flow: dense is not supported by IE', {
|
|
181
|
+
node: decl
|
|
182
|
+
});
|
|
183
|
+
} else if (!hasRows && !hasCols) {
|
|
184
|
+
result.warn('grid-auto-flow works only if grid-template-rows and ' + 'grid-template-columns are present in the same rule', {
|
|
185
|
+
node: decl
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
129
189
|
return undefined;
|
|
130
190
|
} else if (value.indexOf('auto-fit') !== -1) {
|
|
131
191
|
result.warn('auto-fit value is not supported by IE', {
|
|
@@ -241,7 +301,7 @@ function () {
|
|
|
241
301
|
}); // Insert grid-area prefixes. We need to be able to store the different
|
|
242
302
|
// rules as a data and hack API is not enough for this
|
|
243
303
|
|
|
244
|
-
if (this.gridStatus(css, result)
|
|
304
|
+
if (this.gridStatus(css, result)) {
|
|
245
305
|
insertAreas(css, this.disabled);
|
|
246
306
|
} // Values
|
|
247
307
|
|
|
@@ -269,11 +329,11 @@ function () {
|
|
|
269
329
|
|
|
270
330
|
Value.save(_this.prefixes, decl);
|
|
271
331
|
});
|
|
272
|
-
}
|
|
332
|
+
}
|
|
273
333
|
/**
|
|
274
334
|
* Remove unnecessary pefixes
|
|
275
335
|
*/
|
|
276
|
-
|
|
336
|
+
;
|
|
277
337
|
|
|
278
338
|
_proto.remove = function remove(css, result) {
|
|
279
339
|
var _this2 = this;
|
|
@@ -380,19 +440,19 @@ function () {
|
|
|
380
440
|
}
|
|
381
441
|
}
|
|
382
442
|
});
|
|
383
|
-
}
|
|
443
|
+
}
|
|
384
444
|
/**
|
|
385
445
|
* Some rare old values, which is not in standard
|
|
386
446
|
*/
|
|
387
|
-
|
|
447
|
+
;
|
|
388
448
|
|
|
389
449
|
_proto.withHackValue = function withHackValue(decl) {
|
|
390
450
|
return decl.prop === '-webkit-background-clip' && decl.value === 'text';
|
|
391
|
-
}
|
|
451
|
+
}
|
|
392
452
|
/**
|
|
393
453
|
* Check for grid/flexbox options.
|
|
394
454
|
*/
|
|
395
|
-
|
|
455
|
+
;
|
|
396
456
|
|
|
397
457
|
_proto.disabledValue = function disabledValue(node, result) {
|
|
398
458
|
if (this.gridStatus(node, result) === false && node.type === 'decl') {
|
|
@@ -408,11 +468,11 @@ function () {
|
|
|
408
468
|
}
|
|
409
469
|
|
|
410
470
|
return this.disabled(node, result);
|
|
411
|
-
}
|
|
471
|
+
}
|
|
412
472
|
/**
|
|
413
473
|
* Check for grid/flexbox options.
|
|
414
474
|
*/
|
|
415
|
-
|
|
475
|
+
;
|
|
416
476
|
|
|
417
477
|
_proto.disabledDecl = function disabledDecl(node, result) {
|
|
418
478
|
if (this.gridStatus(node, result) === false && node.type === 'decl') {
|
|
@@ -430,11 +490,11 @@ function () {
|
|
|
430
490
|
}
|
|
431
491
|
|
|
432
492
|
return this.disabled(node, result);
|
|
433
|
-
}
|
|
493
|
+
}
|
|
434
494
|
/**
|
|
435
495
|
* Check for control comment and global options
|
|
436
496
|
*/
|
|
437
|
-
|
|
497
|
+
;
|
|
438
498
|
|
|
439
499
|
_proto.disabled = function disabled(node, result) {
|
|
440
500
|
if (!node) return false;
|
|
@@ -492,11 +552,11 @@ function () {
|
|
|
492
552
|
|
|
493
553
|
node._autoprefixerDisabled = value;
|
|
494
554
|
return value;
|
|
495
|
-
}
|
|
555
|
+
}
|
|
496
556
|
/**
|
|
497
557
|
* Normalize spaces in cascade declaration group
|
|
498
558
|
*/
|
|
499
|
-
|
|
559
|
+
;
|
|
500
560
|
|
|
501
561
|
_proto.reduceSpaces = function reduceSpaces(decl) {
|
|
502
562
|
var stop = false;
|
|
@@ -525,11 +585,11 @@ function () {
|
|
|
525
585
|
other.raws.before = parts.join('\n');
|
|
526
586
|
}
|
|
527
587
|
});
|
|
528
|
-
}
|
|
588
|
+
}
|
|
529
589
|
/**
|
|
530
590
|
* Is it flebox or grid rule
|
|
531
591
|
*/
|
|
532
|
-
|
|
592
|
+
;
|
|
533
593
|
|
|
534
594
|
_proto.displayType = function displayType(decl) {
|
|
535
595
|
for (var _iterator4 = decl.parent.nodes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
|
|
@@ -560,11 +620,11 @@ function () {
|
|
|
560
620
|
}
|
|
561
621
|
|
|
562
622
|
return false;
|
|
563
|
-
}
|
|
623
|
+
}
|
|
564
624
|
/**
|
|
565
625
|
* Set grid option via control comment
|
|
566
626
|
*/
|
|
567
|
-
|
|
627
|
+
;
|
|
568
628
|
|
|
569
629
|
_proto.gridStatus = function gridStatus(node, result) {
|
|
570
630
|
if (!node) return false;
|
|
@@ -580,11 +640,18 @@ function () {
|
|
|
580
640
|
node.each(function (i) {
|
|
581
641
|
if (i.type !== 'comment') return;
|
|
582
642
|
|
|
583
|
-
if (
|
|
643
|
+
if (GRID_REGEX.test(i.text)) {
|
|
644
|
+
var hasAutoplace = /:\s*autoplace/i.test(i.text);
|
|
645
|
+
var noAutoplace = /no-autoplace/i.test(i.text);
|
|
646
|
+
|
|
584
647
|
if (typeof status !== 'undefined') {
|
|
585
|
-
result.warn(
|
|
648
|
+
result.warn("Second Autoprefixer grid control comment was " + 'ignored. Autoprefixer applies control comments to the whole ' + 'block, not to the next rules.', {
|
|
586
649
|
node: i
|
|
587
650
|
});
|
|
651
|
+
} else if (hasAutoplace) {
|
|
652
|
+
status = 'autoplace';
|
|
653
|
+
} else if (noAutoplace) {
|
|
654
|
+
status = true;
|
|
588
655
|
} else {
|
|
589
656
|
status = /on/i.test(i.text);
|
|
590
657
|
}
|
package/lib/resolution.js
CHANGED
|
@@ -33,11 +33,11 @@ function (_Prefixer) {
|
|
|
33
33
|
} else {
|
|
34
34
|
return prefix + name + '-device-pixel-ratio';
|
|
35
35
|
}
|
|
36
|
-
}
|
|
36
|
+
}
|
|
37
37
|
/**
|
|
38
38
|
* Return prefixed query
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
;
|
|
41
41
|
|
|
42
42
|
_proto.prefixQuery = function prefixQuery(prefix, name, colon, value, units) {
|
|
43
43
|
if (units === 'dpi') {
|
|
@@ -49,11 +49,11 @@ function (_Prefixer) {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
return this.prefixName(prefix, name) + colon + value;
|
|
52
|
-
}
|
|
52
|
+
}
|
|
53
53
|
/**
|
|
54
54
|
* Remove prefixed queries
|
|
55
55
|
*/
|
|
56
|
-
|
|
56
|
+
;
|
|
57
57
|
|
|
58
58
|
_proto.clean = function clean(rule) {
|
|
59
59
|
var _this = this;
|
|
@@ -86,11 +86,11 @@ function (_Prefixer) {
|
|
|
86
86
|
});
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
|
-
}
|
|
89
|
+
}
|
|
90
90
|
/**
|
|
91
91
|
* Add prefixed queries
|
|
92
92
|
*/
|
|
93
|
-
|
|
93
|
+
;
|
|
94
94
|
|
|
95
95
|
_proto.process = function process(rule) {
|
|
96
96
|
var _this2 = this;
|