autoprefixer 9.4.2 → 9.4.6
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 +16 -2
- package/README.md +5 -5
- package/data/prefixes.js +2 -2
- 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 +6 -6
- 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 +2 -2
- package/lib/hacks/grid-start.js +4 -4
- package/lib/hacks/grid-utils.js +2 -2
- 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/text-decoration-skip-ink.js +40 -0
- package/lib/hacks/transform-decl.js +6 -6
- package/lib/hacks/writing-mode.js +26 -7
- package/lib/old-selector.js +2 -2
- package/lib/prefixer.js +8 -8
- package/lib/prefixes.js +21 -20
- package/lib/processor.js +32 -16
- 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
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
|
@@ -33,6 +33,7 @@ Declaration.hack(require('./hacks/flex-flow'));
|
|
|
33
33
|
Declaration.hack(require('./hacks/flex-grow'));
|
|
34
34
|
Declaration.hack(require('./hacks/flex-wrap'));
|
|
35
35
|
Declaration.hack(require('./hacks/grid-area'));
|
|
36
|
+
Declaration.hack(require('./hacks/place-self'));
|
|
36
37
|
Declaration.hack(require('./hacks/grid-start'));
|
|
37
38
|
Declaration.hack(require('./hacks/align-self'));
|
|
38
39
|
Declaration.hack(require('./hacks/appearance'));
|
|
@@ -41,6 +42,7 @@ Declaration.hack(require('./hacks/mask-border'));
|
|
|
41
42
|
Declaration.hack(require('./hacks/align-items'));
|
|
42
43
|
Declaration.hack(require('./hacks/flex-shrink'));
|
|
43
44
|
Declaration.hack(require('./hacks/break-props'));
|
|
45
|
+
Declaration.hack(require('./hacks/color-adjust'));
|
|
44
46
|
Declaration.hack(require('./hacks/writing-mode'));
|
|
45
47
|
Declaration.hack(require('./hacks/border-image'));
|
|
46
48
|
Declaration.hack(require('./hacks/align-content'));
|
|
@@ -62,8 +64,7 @@ Declaration.hack(require('./hacks/grid-column-align'));
|
|
|
62
64
|
Declaration.hack(require('./hacks/overscroll-behavior'));
|
|
63
65
|
Declaration.hack(require('./hacks/grid-template-areas'));
|
|
64
66
|
Declaration.hack(require('./hacks/text-emphasis-position'));
|
|
65
|
-
Declaration.hack(require('./hacks/
|
|
66
|
-
Declaration.hack(require('./hacks/place-self'));
|
|
67
|
+
Declaration.hack(require('./hacks/text-decoration-skip-ink'));
|
|
67
68
|
Value.hack(require('./hacks/gradient'));
|
|
68
69
|
Value.hack(require('./hacks/intrinsic'));
|
|
69
70
|
Value.hack(require('./hacks/pixelated'));
|
|
@@ -113,11 +114,11 @@ function () {
|
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
return this.cleanerCache;
|
|
116
|
-
}
|
|
117
|
+
}
|
|
117
118
|
/**
|
|
118
119
|
* Select prefixes from data, which is necessary for selected browsers
|
|
119
120
|
*/
|
|
120
|
-
|
|
121
|
+
;
|
|
121
122
|
|
|
122
123
|
_proto.select = function select(list) {
|
|
123
124
|
var _this = this;
|
|
@@ -190,11 +191,11 @@ function () {
|
|
|
190
191
|
}
|
|
191
192
|
|
|
192
193
|
return selected;
|
|
193
|
-
}
|
|
194
|
+
}
|
|
194
195
|
/**
|
|
195
196
|
* Sort vendor prefixes
|
|
196
197
|
*/
|
|
197
|
-
|
|
198
|
+
;
|
|
198
199
|
|
|
199
200
|
_proto.sort = function sort(prefixes) {
|
|
200
201
|
return prefixes.sort(function (a, b) {
|
|
@@ -207,11 +208,11 @@ function () {
|
|
|
207
208
|
return bLength - aLength;
|
|
208
209
|
}
|
|
209
210
|
});
|
|
210
|
-
}
|
|
211
|
+
}
|
|
211
212
|
/**
|
|
212
213
|
* Cache prefixes data to fast CSS processing
|
|
213
214
|
*/
|
|
214
|
-
|
|
215
|
+
;
|
|
215
216
|
|
|
216
217
|
_proto.preprocess = function preprocess(selected) {
|
|
217
218
|
var add = {
|
|
@@ -415,11 +416,11 @@ function () {
|
|
|
415
416
|
}
|
|
416
417
|
|
|
417
418
|
return [add, remove];
|
|
418
|
-
}
|
|
419
|
+
}
|
|
419
420
|
/**
|
|
420
421
|
* Declaration loader with caching
|
|
421
422
|
*/
|
|
422
|
-
|
|
423
|
+
;
|
|
423
424
|
|
|
424
425
|
_proto.decl = function decl(prop) {
|
|
425
426
|
var decl = declsCache[prop];
|
|
@@ -430,11 +431,11 @@ function () {
|
|
|
430
431
|
declsCache[prop] = Declaration.load(prop);
|
|
431
432
|
return declsCache[prop];
|
|
432
433
|
}
|
|
433
|
-
}
|
|
434
|
+
}
|
|
434
435
|
/**
|
|
435
436
|
* Return unprefixed version of property
|
|
436
437
|
*/
|
|
437
|
-
|
|
438
|
+
;
|
|
438
439
|
|
|
439
440
|
_proto.unprefixed = function unprefixed(prop) {
|
|
440
441
|
var value = this.normalize(vendor.unprefixed(prop));
|
|
@@ -444,28 +445,28 @@ function () {
|
|
|
444
445
|
}
|
|
445
446
|
|
|
446
447
|
return value;
|
|
447
|
-
}
|
|
448
|
+
}
|
|
448
449
|
/**
|
|
449
450
|
* Normalize prefix for remover
|
|
450
451
|
*/
|
|
451
|
-
|
|
452
|
+
;
|
|
452
453
|
|
|
453
454
|
_proto.normalize = function normalize(prop) {
|
|
454
455
|
return this.decl(prop).normalize(prop);
|
|
455
|
-
}
|
|
456
|
+
}
|
|
456
457
|
/**
|
|
457
458
|
* Return prefixed version of property
|
|
458
459
|
*/
|
|
459
|
-
|
|
460
|
+
;
|
|
460
461
|
|
|
461
462
|
_proto.prefixed = function prefixed(prop, prefix) {
|
|
462
463
|
prop = vendor.unprefixed(prop);
|
|
463
464
|
return this.decl(prop).prefixed(prop, prefix);
|
|
464
|
-
}
|
|
465
|
+
}
|
|
465
466
|
/**
|
|
466
467
|
* Return values, which must be prefixed in selected property
|
|
467
468
|
*/
|
|
468
|
-
|
|
469
|
+
;
|
|
469
470
|
|
|
470
471
|
_proto.values = function values(type, prop) {
|
|
471
472
|
var data = this[type];
|
|
@@ -477,11 +478,11 @@ function () {
|
|
|
477
478
|
} else {
|
|
478
479
|
return global || values || [];
|
|
479
480
|
}
|
|
480
|
-
}
|
|
481
|
+
}
|
|
481
482
|
/**
|
|
482
483
|
* Group declaration by unprefixed property to check them
|
|
483
484
|
*/
|
|
484
|
-
|
|
485
|
+
;
|
|
485
486
|
|
|
486
487
|
_proto.group = function group(decl) {
|
|
487
488
|
var _this2 = this;
|
package/lib/processor.js
CHANGED
|
@@ -86,6 +86,12 @@ function () {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
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
|
+
|
|
89
95
|
var gridPrefixes = this.gridStatus(css, result) && this.prefixes.add['grid-area'] && this.prefixes.add['grid-area'].prefixes;
|
|
90
96
|
css.walkDecls(function (decl) {
|
|
91
97
|
if (_this.disabledDecl(decl, result)) return undefined;
|
|
@@ -114,6 +120,16 @@ function () {
|
|
|
114
120
|
node: decl
|
|
115
121
|
});
|
|
116
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
|
+
}
|
|
129
|
+
} else if (prop === 'text-decoration-skip' && value === 'ink') {
|
|
130
|
+
result.warn('Replace text-decoration-skip: ink to ' + 'text-decoration-skip-ink: auto, because spec had been changed', {
|
|
131
|
+
node: decl
|
|
132
|
+
});
|
|
117
133
|
} else {
|
|
118
134
|
if (gridPrefixes) {
|
|
119
135
|
if (/^(align|justify|place)-items$/.test(prop) && insideGrid(decl)) {
|
|
@@ -317,11 +333,11 @@ function () {
|
|
|
317
333
|
|
|
318
334
|
Value.save(_this.prefixes, decl);
|
|
319
335
|
});
|
|
320
|
-
}
|
|
336
|
+
}
|
|
321
337
|
/**
|
|
322
338
|
* Remove unnecessary pefixes
|
|
323
339
|
*/
|
|
324
|
-
|
|
340
|
+
;
|
|
325
341
|
|
|
326
342
|
_proto.remove = function remove(css, result) {
|
|
327
343
|
var _this2 = this;
|
|
@@ -428,19 +444,19 @@ function () {
|
|
|
428
444
|
}
|
|
429
445
|
}
|
|
430
446
|
});
|
|
431
|
-
}
|
|
447
|
+
}
|
|
432
448
|
/**
|
|
433
449
|
* Some rare old values, which is not in standard
|
|
434
450
|
*/
|
|
435
|
-
|
|
451
|
+
;
|
|
436
452
|
|
|
437
453
|
_proto.withHackValue = function withHackValue(decl) {
|
|
438
454
|
return decl.prop === '-webkit-background-clip' && decl.value === 'text';
|
|
439
|
-
}
|
|
455
|
+
}
|
|
440
456
|
/**
|
|
441
457
|
* Check for grid/flexbox options.
|
|
442
458
|
*/
|
|
443
|
-
|
|
459
|
+
;
|
|
444
460
|
|
|
445
461
|
_proto.disabledValue = function disabledValue(node, result) {
|
|
446
462
|
if (this.gridStatus(node, result) === false && node.type === 'decl') {
|
|
@@ -456,11 +472,11 @@ function () {
|
|
|
456
472
|
}
|
|
457
473
|
|
|
458
474
|
return this.disabled(node, result);
|
|
459
|
-
}
|
|
475
|
+
}
|
|
460
476
|
/**
|
|
461
477
|
* Check for grid/flexbox options.
|
|
462
478
|
*/
|
|
463
|
-
|
|
479
|
+
;
|
|
464
480
|
|
|
465
481
|
_proto.disabledDecl = function disabledDecl(node, result) {
|
|
466
482
|
if (this.gridStatus(node, result) === false && node.type === 'decl') {
|
|
@@ -478,11 +494,11 @@ function () {
|
|
|
478
494
|
}
|
|
479
495
|
|
|
480
496
|
return this.disabled(node, result);
|
|
481
|
-
}
|
|
497
|
+
}
|
|
482
498
|
/**
|
|
483
499
|
* Check for control comment and global options
|
|
484
500
|
*/
|
|
485
|
-
|
|
501
|
+
;
|
|
486
502
|
|
|
487
503
|
_proto.disabled = function disabled(node, result) {
|
|
488
504
|
if (!node) return false;
|
|
@@ -540,11 +556,11 @@ function () {
|
|
|
540
556
|
|
|
541
557
|
node._autoprefixerDisabled = value;
|
|
542
558
|
return value;
|
|
543
|
-
}
|
|
559
|
+
}
|
|
544
560
|
/**
|
|
545
561
|
* Normalize spaces in cascade declaration group
|
|
546
562
|
*/
|
|
547
|
-
|
|
563
|
+
;
|
|
548
564
|
|
|
549
565
|
_proto.reduceSpaces = function reduceSpaces(decl) {
|
|
550
566
|
var stop = false;
|
|
@@ -573,11 +589,11 @@ function () {
|
|
|
573
589
|
other.raws.before = parts.join('\n');
|
|
574
590
|
}
|
|
575
591
|
});
|
|
576
|
-
}
|
|
592
|
+
}
|
|
577
593
|
/**
|
|
578
594
|
* Is it flebox or grid rule
|
|
579
595
|
*/
|
|
580
|
-
|
|
596
|
+
;
|
|
581
597
|
|
|
582
598
|
_proto.displayType = function displayType(decl) {
|
|
583
599
|
for (var _iterator4 = decl.parent.nodes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
|
|
@@ -608,11 +624,11 @@ function () {
|
|
|
608
624
|
}
|
|
609
625
|
|
|
610
626
|
return false;
|
|
611
|
-
}
|
|
627
|
+
}
|
|
612
628
|
/**
|
|
613
629
|
* Set grid option via control comment
|
|
614
630
|
*/
|
|
615
|
-
|
|
631
|
+
;
|
|
616
632
|
|
|
617
633
|
_proto.gridStatus = function gridStatus(node, result) {
|
|
618
634
|
if (!node) return false;
|
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;
|
package/lib/selector.js
CHANGED
|
@@ -37,19 +37,19 @@ function (_Prefixer) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
return false;
|
|
40
|
-
}
|
|
40
|
+
}
|
|
41
41
|
/**
|
|
42
42
|
* Return prefixed version of selector
|
|
43
43
|
*/
|
|
44
|
-
|
|
44
|
+
;
|
|
45
45
|
|
|
46
46
|
_proto.prefixed = function prefixed(prefix) {
|
|
47
47
|
return this.name.replace(/^([^\w]*)/, "$1" + prefix);
|
|
48
|
-
}
|
|
48
|
+
}
|
|
49
49
|
/**
|
|
50
50
|
* Lazy loadRegExp for name
|
|
51
51
|
*/
|
|
52
|
-
|
|
52
|
+
;
|
|
53
53
|
|
|
54
54
|
_proto.regexp = function regexp(prefix) {
|
|
55
55
|
if (this.regexpCache[prefix]) {
|
|
@@ -59,19 +59,19 @@ function (_Prefixer) {
|
|
|
59
59
|
var name = prefix ? this.prefixed(prefix) : this.name;
|
|
60
60
|
this.regexpCache[prefix] = new RegExp("(^|[^:\"'=])" + utils.escapeRegexp(name), 'gi');
|
|
61
61
|
return this.regexpCache[prefix];
|
|
62
|
-
}
|
|
62
|
+
}
|
|
63
63
|
/**
|
|
64
64
|
* All possible prefixes
|
|
65
65
|
*/
|
|
66
|
-
|
|
66
|
+
;
|
|
67
67
|
|
|
68
68
|
_proto.possible = function possible() {
|
|
69
69
|
return Browsers.prefixes();
|
|
70
|
-
}
|
|
70
|
+
}
|
|
71
71
|
/**
|
|
72
72
|
* Return all possible selector prefixes
|
|
73
73
|
*/
|
|
74
|
-
|
|
74
|
+
;
|
|
75
75
|
|
|
76
76
|
_proto.prefixeds = function prefixeds(rule) {
|
|
77
77
|
if (rule._autoprefixerPrefixeds) {
|
|
@@ -98,11 +98,11 @@ function (_Prefixer) {
|
|
|
98
98
|
|
|
99
99
|
rule._autoprefixerPrefixeds = prefixeds;
|
|
100
100
|
return rule._autoprefixerPrefixeds;
|
|
101
|
-
}
|
|
101
|
+
}
|
|
102
102
|
/**
|
|
103
103
|
* Is rule already prefixed before
|
|
104
104
|
*/
|
|
105
|
-
|
|
105
|
+
;
|
|
106
106
|
|
|
107
107
|
_proto.already = function already(rule, prefixeds, prefix) {
|
|
108
108
|
var index = rule.parent.index(rule) - 1;
|
|
@@ -137,19 +137,19 @@ function (_Prefixer) {
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
return false;
|
|
140
|
-
}
|
|
140
|
+
}
|
|
141
141
|
/**
|
|
142
142
|
* Replace selectors by prefixed one
|
|
143
143
|
*/
|
|
144
|
-
|
|
144
|
+
;
|
|
145
145
|
|
|
146
146
|
_proto.replace = function replace(selector, prefix) {
|
|
147
147
|
return selector.replace(this.regexp(), "$1" + this.prefixed(prefix));
|
|
148
|
-
}
|
|
148
|
+
}
|
|
149
149
|
/**
|
|
150
150
|
* Clone and add prefixes for at-rule
|
|
151
151
|
*/
|
|
152
|
-
|
|
152
|
+
;
|
|
153
153
|
|
|
154
154
|
_proto.add = function add(rule, prefix) {
|
|
155
155
|
var prefixeds = this.prefixeds(rule);
|
|
@@ -162,11 +162,11 @@ function (_Prefixer) {
|
|
|
162
162
|
selector: prefixeds[prefix]
|
|
163
163
|
});
|
|
164
164
|
rule.parent.insertBefore(rule, cloned);
|
|
165
|
-
}
|
|
165
|
+
}
|
|
166
166
|
/**
|
|
167
167
|
* Return function to fast find prefixed selector
|
|
168
168
|
*/
|
|
169
|
-
|
|
169
|
+
;
|
|
170
170
|
|
|
171
171
|
_proto.old = function old(prefix) {
|
|
172
172
|
return new OldSelector(this, prefix);
|
package/lib/supports.js
CHANGED
|
@@ -51,11 +51,11 @@ function () {
|
|
|
51
51
|
var browsers = new Browsers(this.all.browsers.data, filtered, this.all.options);
|
|
52
52
|
this.prefixerCache = new this.Prefixes(this.all.data, browsers, this.all.options);
|
|
53
53
|
return this.prefixerCache;
|
|
54
|
-
}
|
|
54
|
+
}
|
|
55
55
|
/**
|
|
56
56
|
* Parse string into declaration property and value
|
|
57
57
|
*/
|
|
58
|
-
|
|
58
|
+
;
|
|
59
59
|
|
|
60
60
|
_proto.parse = function parse(str) {
|
|
61
61
|
var parts = str.split(':');
|
|
@@ -63,11 +63,11 @@ function () {
|
|
|
63
63
|
var value = parts[1];
|
|
64
64
|
if (!value) value = '';
|
|
65
65
|
return [prop.trim(), value.trim()];
|
|
66
|
-
}
|
|
66
|
+
}
|
|
67
67
|
/**
|
|
68
68
|
* Create virtual rule to process it by prefixer
|
|
69
69
|
*/
|
|
70
|
-
|
|
70
|
+
;
|
|
71
71
|
|
|
72
72
|
_proto.virtual = function virtual(str) {
|
|
73
73
|
var _this$parse = this.parse(str),
|
|
@@ -83,11 +83,11 @@ function () {
|
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
return rule;
|
|
86
|
-
}
|
|
86
|
+
}
|
|
87
87
|
/**
|
|
88
88
|
* Return array of Declaration with all necessary prefixes
|
|
89
89
|
*/
|
|
90
|
-
|
|
90
|
+
;
|
|
91
91
|
|
|
92
92
|
_proto.prefixed = function prefixed(str) {
|
|
93
93
|
var rule = this.virtual(str);
|
|
@@ -138,44 +138,44 @@ function () {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
return rule.nodes;
|
|
141
|
-
}
|
|
141
|
+
}
|
|
142
142
|
/**
|
|
143
143
|
* Return true if brackets node is "not" word
|
|
144
144
|
*/
|
|
145
|
-
|
|
145
|
+
;
|
|
146
146
|
|
|
147
147
|
_proto.isNot = function isNot(node) {
|
|
148
148
|
return typeof node === 'string' && /not\s*/i.test(node);
|
|
149
|
-
}
|
|
149
|
+
}
|
|
150
150
|
/**
|
|
151
151
|
* Return true if brackets node is "or" word
|
|
152
152
|
*/
|
|
153
|
-
|
|
153
|
+
;
|
|
154
154
|
|
|
155
155
|
_proto.isOr = function isOr(node) {
|
|
156
156
|
return typeof node === 'string' && /\s*or\s*/i.test(node);
|
|
157
|
-
}
|
|
157
|
+
}
|
|
158
158
|
/**
|
|
159
159
|
* Return true if brackets node is (prop: value)
|
|
160
160
|
*/
|
|
161
|
-
|
|
161
|
+
;
|
|
162
162
|
|
|
163
163
|
_proto.isProp = function isProp(node) {
|
|
164
164
|
return typeof node === 'object' && node.length === 1 && typeof node[0] === 'string';
|
|
165
|
-
}
|
|
165
|
+
}
|
|
166
166
|
/**
|
|
167
167
|
* Return true if prefixed property has no unprefixed
|
|
168
168
|
*/
|
|
169
|
-
|
|
169
|
+
;
|
|
170
170
|
|
|
171
171
|
_proto.isHack = function isHack(all, unprefixed) {
|
|
172
172
|
var check = new RegExp("(\\(|\\s)" + utils.escapeRegexp(unprefixed) + ":");
|
|
173
173
|
return !check.test(all);
|
|
174
|
-
}
|
|
174
|
+
}
|
|
175
175
|
/**
|
|
176
176
|
* Return true if we need to remove node
|
|
177
177
|
*/
|
|
178
|
-
|
|
178
|
+
;
|
|
179
179
|
|
|
180
180
|
_proto.toRemove = function toRemove(str, all) {
|
|
181
181
|
var _this$parse2 = this.parse(str),
|
|
@@ -209,11 +209,11 @@ function () {
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
return false;
|
|
212
|
-
}
|
|
212
|
+
}
|
|
213
213
|
/**
|
|
214
214
|
* Remove all unnecessary prefixes
|
|
215
215
|
*/
|
|
216
|
-
|
|
216
|
+
;
|
|
217
217
|
|
|
218
218
|
_proto.remove = function remove(nodes, all) {
|
|
219
219
|
var i = 0;
|
|
@@ -237,11 +237,11 @@ function () {
|
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
return nodes;
|
|
240
|
-
}
|
|
240
|
+
}
|
|
241
241
|
/**
|
|
242
242
|
* Clean brackets with one child
|
|
243
243
|
*/
|
|
244
|
-
|
|
244
|
+
;
|
|
245
245
|
|
|
246
246
|
_proto.cleanBrackets = function cleanBrackets(nodes) {
|
|
247
247
|
var _this = this;
|
|
@@ -257,11 +257,11 @@ function () {
|
|
|
257
257
|
|
|
258
258
|
return _this.cleanBrackets(i);
|
|
259
259
|
});
|
|
260
|
-
}
|
|
260
|
+
}
|
|
261
261
|
/**
|
|
262
262
|
* Add " or " between properties and convert it to brackets format
|
|
263
263
|
*/
|
|
264
|
-
|
|
264
|
+
;
|
|
265
265
|
|
|
266
266
|
_proto.convert = function convert(progress) {
|
|
267
267
|
var result = [''];
|
|
@@ -285,11 +285,11 @@ function () {
|
|
|
285
285
|
|
|
286
286
|
result[result.length - 1] = '';
|
|
287
287
|
return result;
|
|
288
|
-
}
|
|
288
|
+
}
|
|
289
289
|
/**
|
|
290
290
|
* Compress value functions into a string nodes
|
|
291
291
|
*/
|
|
292
|
-
|
|
292
|
+
;
|
|
293
293
|
|
|
294
294
|
_proto.normalize = function normalize(nodes) {
|
|
295
295
|
var _this2 = this;
|
|
@@ -309,11 +309,11 @@ function () {
|
|
|
309
309
|
return nodes.map(function (i) {
|
|
310
310
|
return _this2.normalize(i);
|
|
311
311
|
});
|
|
312
|
-
}
|
|
312
|
+
}
|
|
313
313
|
/**
|
|
314
314
|
* Add prefixes
|
|
315
315
|
*/
|
|
316
|
-
|
|
316
|
+
;
|
|
317
317
|
|
|
318
318
|
_proto.add = function add(nodes, all) {
|
|
319
319
|
var _this3 = this;
|
|
@@ -335,11 +335,11 @@ function () {
|
|
|
335
335
|
|
|
336
336
|
return i;
|
|
337
337
|
});
|
|
338
|
-
}
|
|
338
|
+
}
|
|
339
339
|
/**
|
|
340
340
|
* Add prefixed declaration
|
|
341
341
|
*/
|
|
342
|
-
|
|
342
|
+
;
|
|
343
343
|
|
|
344
344
|
_proto.process = function process(rule) {
|
|
345
345
|
var ast = brackets.parse(rule.params);
|
|
@@ -348,11 +348,11 @@ function () {
|
|
|
348
348
|
ast = this.add(ast, rule.params);
|
|
349
349
|
ast = this.cleanBrackets(ast);
|
|
350
350
|
rule.params = brackets.stringify(ast);
|
|
351
|
-
}
|
|
351
|
+
}
|
|
352
352
|
/**
|
|
353
353
|
* Check global options
|
|
354
354
|
*/
|
|
355
|
-
|
|
355
|
+
;
|
|
356
356
|
|
|
357
357
|
_proto.disabled = function disabled(node) {
|
|
358
358
|
if (!this.all.options.grid) {
|