autoprefixer 6.7.6 → 7.1.0
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/AUTHORS +1 -0
- package/CHANGELOG.md +23 -0
- package/README.md +10 -16
- package/data/prefixes.js +551 -517
- package/lib/at-rule.js +55 -38
- package/lib/autoprefixer.js +89 -63
- package/lib/brackets.js +59 -39
- package/lib/browsers.js +102 -65
- package/lib/declaration.js +212 -121
- package/lib/hacks/align-content.js +65 -38
- package/lib/hacks/align-items.js +62 -38
- package/lib/hacks/align-self.js +63 -36
- package/lib/hacks/appearance.js +42 -0
- package/lib/hacks/background-size.js +29 -20
- package/lib/hacks/block-logical.js +36 -21
- package/lib/hacks/border-image.js +26 -16
- package/lib/hacks/border-radius.js +60 -39
- package/lib/hacks/break-props.js +69 -44
- package/lib/hacks/cross-fade.js +40 -37
- package/lib/hacks/display-flex.js +81 -31
- package/lib/hacks/display-grid.js +29 -19
- package/lib/hacks/filter-value.js +66 -45
- package/lib/hacks/filter.js +26 -17
- package/lib/hacks/flex-basis.js +60 -30
- package/lib/hacks/flex-direction.js +85 -53
- package/lib/hacks/flex-flow.js +67 -49
- package/lib/hacks/flex-grow.js +45 -26
- package/lib/hacks/flex-shrink.js +60 -30
- package/lib/hacks/flex-spec.js +18 -8
- package/lib/hacks/flex-values.js +39 -20
- package/lib/hacks/flex-wrap.js +29 -20
- package/lib/hacks/flex.js +68 -43
- package/lib/hacks/fullscreen.js +31 -21
- package/lib/hacks/gradient.js +462 -302
- package/lib/hacks/grid-column-align.js +55 -0
- package/lib/hacks/grid-end.js +53 -28
- package/lib/hacks/grid-row-align.js +39 -19
- package/lib/hacks/grid-start.js +80 -48
- package/lib/hacks/grid-template.js +91 -55
- package/lib/hacks/image-rendering.js +63 -33
- package/lib/hacks/image-set.js +28 -20
- package/lib/hacks/inline-logical.js +32 -17
- package/lib/hacks/intrinsic.js +66 -0
- package/lib/hacks/justify-content.js +69 -42
- package/lib/hacks/mask-border.js +36 -21
- package/lib/hacks/order.js +58 -35
- package/lib/hacks/pixelated.js +44 -30
- package/lib/hacks/placeholder.js +40 -25
- package/lib/hacks/text-emphasis-position.js +27 -20
- package/lib/hacks/transform-decl.js +94 -52
- package/lib/hacks/writing-mode.js +37 -27
- package/lib/info.js +117 -78
- package/lib/old-selector.js +84 -58
- package/lib/old-value.js +22 -20
- package/lib/prefixer.js +164 -95
- package/lib/prefixes.js +446 -351
- package/lib/processor.js +394 -278
- package/lib/resolution.js +135 -75
- package/lib/selector.js +145 -84
- package/lib/supports.js +330 -210
- package/lib/transition.js +396 -243
- package/lib/utils.js +84 -48
- package/lib/value.js +118 -80
- package/package.json +54 -14
- package/lib/hacks/justify-items.js +0 -31
- package/lib/hacks/stretch.js +0 -45
|
@@ -0,0 +1,55 @@
|
|
|
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 Declaration = require('../declaration');
|
|
10
|
+
|
|
11
|
+
var GridColumnAlign = function (_Declaration) {
|
|
12
|
+
_inherits(GridColumnAlign, _Declaration);
|
|
13
|
+
|
|
14
|
+
function GridColumnAlign() {
|
|
15
|
+
_classCallCheck(this, GridColumnAlign);
|
|
16
|
+
|
|
17
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Do not prefix flexbox values
|
|
22
|
+
*/
|
|
23
|
+
GridColumnAlign.prototype.check = function check(decl) {
|
|
24
|
+
return decl.value.indexOf('flex-') === -1 && decl.value !== 'baseline';
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Change property name for IE
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
GridColumnAlign.prototype.prefixed = function prefixed(prop, prefix) {
|
|
33
|
+
return prefix + 'grid-column-align';
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Change IE property back
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
GridColumnAlign.prototype.normalize = function normalize() {
|
|
42
|
+
return 'justify-self';
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return GridColumnAlign;
|
|
46
|
+
}(Declaration);
|
|
47
|
+
|
|
48
|
+
Object.defineProperty(GridColumnAlign, 'names', {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
writable: true,
|
|
51
|
+
value: ['grid-column-align']
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
module.exports = GridColumnAlign;
|
package/lib/hacks/grid-end.js
CHANGED
|
@@ -1,46 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
var Declaration, GridEnd,
|
|
3
|
-
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
|
4
|
-
hasProp = {}.hasOwnProperty;
|
|
1
|
+
'use strict';
|
|
5
2
|
|
|
6
|
-
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
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 Declaration = require('../declaration');
|
|
10
|
+
|
|
11
|
+
var GridEnd = function (_Declaration) {
|
|
12
|
+
_inherits(GridEnd, _Declaration);
|
|
10
13
|
|
|
11
14
|
function GridEnd() {
|
|
12
|
-
|
|
13
|
-
}
|
|
15
|
+
_classCallCheck(this, GridEnd);
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
18
|
+
}
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Do not add prefix for unsupported value in IE
|
|
22
|
+
*/
|
|
23
|
+
GridEnd.prototype.check = function check(decl) {
|
|
24
|
+
return decl.value.indexOf('span') !== -1;
|
|
19
25
|
};
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Return a final spec property
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
GridEnd.prototype.normalize = function normalize(prop) {
|
|
33
|
+
return prop.replace(/(-span|-end)/, '');
|
|
23
34
|
};
|
|
24
35
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Change property name for IE
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
GridEnd.prototype.prefixed = function prefixed(prop, prefix) {
|
|
42
|
+
if (prefix === '-ms-') {
|
|
43
|
+
return prefix + prop.replace('-end', '-span');
|
|
44
|
+
} else {
|
|
45
|
+
return _Declaration.prototype.prefixed.call(this, prop, prefix);
|
|
46
|
+
}
|
|
31
47
|
};
|
|
32
48
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Change repeating syntax for IE
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
GridEnd.prototype.set = function set(decl, prefix) {
|
|
55
|
+
if (prefix === '-ms-') {
|
|
56
|
+
decl.value = decl.value.replace(/span\s/i, '');
|
|
57
|
+
}
|
|
58
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
38
59
|
};
|
|
39
60
|
|
|
40
61
|
return GridEnd;
|
|
62
|
+
}(Declaration);
|
|
41
63
|
|
|
42
|
-
|
|
64
|
+
Object.defineProperty(GridEnd, 'names', {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
writable: true,
|
|
67
|
+
value: ['grid-row-end', 'grid-column-end', 'grid-row-span', 'grid-column-span']
|
|
68
|
+
});
|
|
43
69
|
|
|
44
|
-
module.exports = GridEnd;
|
|
45
70
|
|
|
46
|
-
|
|
71
|
+
module.exports = GridEnd;
|
|
@@ -1,35 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
var Declaration, GridRowAlign,
|
|
3
|
-
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
|
4
|
-
hasProp = {}.hasOwnProperty;
|
|
1
|
+
'use strict';
|
|
5
2
|
|
|
6
|
-
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
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 Declaration = require('../declaration');
|
|
10
|
+
|
|
11
|
+
var GridRowAlign = function (_Declaration) {
|
|
12
|
+
_inherits(GridRowAlign, _Declaration);
|
|
10
13
|
|
|
11
14
|
function GridRowAlign() {
|
|
12
|
-
|
|
13
|
-
}
|
|
15
|
+
_classCallCheck(this, GridRowAlign);
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
18
|
+
}
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Do not prefix flexbox values
|
|
22
|
+
*/
|
|
23
|
+
GridRowAlign.prototype.check = function check(decl) {
|
|
24
|
+
return decl.value.indexOf('flex-') === -1 && decl.value !== 'baseline';
|
|
19
25
|
};
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Change property name for IE
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
GridRowAlign.prototype.prefixed = function prefixed(prop, prefix) {
|
|
33
|
+
return prefix + 'grid-row-align';
|
|
23
34
|
};
|
|
24
35
|
|
|
25
|
-
|
|
26
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Change IE property back
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
GridRowAlign.prototype.normalize = function normalize() {
|
|
42
|
+
return 'align-self';
|
|
27
43
|
};
|
|
28
44
|
|
|
29
45
|
return GridRowAlign;
|
|
46
|
+
}(Declaration);
|
|
30
47
|
|
|
31
|
-
|
|
48
|
+
Object.defineProperty(GridRowAlign, 'names', {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
writable: true,
|
|
51
|
+
value: ['grid-row-align']
|
|
52
|
+
});
|
|
32
53
|
|
|
33
|
-
module.exports = GridRowAlign;
|
|
34
54
|
|
|
35
|
-
|
|
55
|
+
module.exports = GridRowAlign;
|
package/lib/hacks/grid-start.js
CHANGED
|
@@ -1,71 +1,103 @@
|
|
|
1
|
-
|
|
2
|
-
var Declaration, GridStart,
|
|
3
|
-
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
|
4
|
-
hasProp = {}.hasOwnProperty;
|
|
1
|
+
'use strict';
|
|
5
2
|
|
|
6
|
-
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
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 Declaration = require('../declaration');
|
|
10
|
+
|
|
11
|
+
var GridStart = function (_Declaration) {
|
|
12
|
+
_inherits(GridStart, _Declaration);
|
|
10
13
|
|
|
11
14
|
function GridStart() {
|
|
12
|
-
|
|
13
|
-
}
|
|
15
|
+
_classCallCheck(this, GridStart);
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
18
|
+
}
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Do not add prefix for unsupported value in IE
|
|
22
|
+
*/
|
|
23
|
+
GridStart.prototype.check = function check(decl) {
|
|
24
|
+
return decl.value.indexOf('/') === -1 || decl.value.indexOf('span') !== -1;
|
|
19
25
|
};
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Return a final spec property
|
|
29
|
+
*/
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return
|
|
28
|
-
} else {
|
|
29
|
-
return GridStart.__super__.prefixed.call(this, prop, prefix);
|
|
30
|
-
}
|
|
31
|
+
|
|
32
|
+
GridStart.prototype.normalize = function normalize(prop) {
|
|
33
|
+
return prop.replace('-start', '');
|
|
31
34
|
};
|
|
32
35
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Change property name for IE
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
GridStart.prototype.prefixed = function prefixed(prop, prefix) {
|
|
42
|
+
if (prefix === '-ms-') {
|
|
43
|
+
return prefix + prop.replace('-start', '');
|
|
44
|
+
} else {
|
|
45
|
+
return _Declaration.prototype.prefixed.call(this, prop, prefix);
|
|
46
|
+
}
|
|
43
47
|
};
|
|
44
48
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Split one value to two
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
GridStart.prototype.insert = function insert(decl, prefix, prefixes) {
|
|
55
|
+
var parts = this.splitValue(decl, prefix);
|
|
56
|
+
if (parts.length === 2) {
|
|
57
|
+
decl.cloneBefore({
|
|
58
|
+
prop: '-ms-' + decl.prop + '-span',
|
|
59
|
+
value: parts[1]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return _Declaration.prototype.insert.call(this, decl, prefix, prefixes);
|
|
52
63
|
};
|
|
53
64
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Change value for combine property
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
GridStart.prototype.set = function set(decl, prefix) {
|
|
71
|
+
var parts = this.splitValue(decl, prefix);
|
|
58
72
|
if (parts.length === 2) {
|
|
59
|
-
|
|
73
|
+
decl.value = parts[0];
|
|
74
|
+
}
|
|
75
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* If property contains start and end
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
GridStart.prototype.splitValue = function splitValue(decl, prefix) {
|
|
84
|
+
if (prefix === '-ms-' && decl.prop.indexOf('-start') === -1) {
|
|
85
|
+
var parts = decl.value.split(/\s*\/\s*span\s+/);
|
|
86
|
+
if (parts.length === 2) {
|
|
87
|
+
return parts;
|
|
88
|
+
}
|
|
60
89
|
}
|
|
61
|
-
|
|
62
|
-
return false;
|
|
90
|
+
return false;
|
|
63
91
|
};
|
|
64
92
|
|
|
65
93
|
return GridStart;
|
|
94
|
+
}(Declaration);
|
|
66
95
|
|
|
67
|
-
|
|
96
|
+
Object.defineProperty(GridStart, 'names', {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
writable: true,
|
|
99
|
+
value: ['grid-row-start', 'grid-column-start', 'grid-row', 'grid-column']
|
|
100
|
+
});
|
|
68
101
|
|
|
69
|
-
module.exports = GridStart;
|
|
70
102
|
|
|
71
|
-
|
|
103
|
+
module.exports = GridStart;
|
|
@@ -1,77 +1,113 @@
|
|
|
1
|
-
|
|
2
|
-
var Declaration, GridTemplate, parser,
|
|
3
|
-
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
|
4
|
-
hasProp = {}.hasOwnProperty;
|
|
1
|
+
'use strict';
|
|
5
2
|
|
|
6
|
-
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
4
|
|
|
8
|
-
|
|
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; }
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
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 parser = require('postcss-value-parser');
|
|
10
|
+
|
|
11
|
+
var Declaration = require('../declaration');
|
|
12
|
+
|
|
13
|
+
var GridTemplate = function (_Declaration) {
|
|
14
|
+
_inherits(GridTemplate, _Declaration);
|
|
12
15
|
|
|
13
16
|
function GridTemplate() {
|
|
14
|
-
|
|
15
|
-
}
|
|
17
|
+
_classCallCheck(this, GridTemplate);
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
20
|
+
}
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Change property name for IE
|
|
24
|
+
*/
|
|
25
|
+
GridTemplate.prototype.prefixed = function prefixed(prop, prefix) {
|
|
26
|
+
if (prefix === '-ms-') {
|
|
27
|
+
return prefix + prop.replace('template-', '');
|
|
28
|
+
} else {
|
|
29
|
+
return _Declaration.prototype.prefixed.call(this, prop, prefix);
|
|
30
|
+
}
|
|
25
31
|
};
|
|
26
32
|
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Change IE property back
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
GridTemplate.prototype.normalize = function normalize(prop) {
|
|
39
|
+
return prop.replace(/^grid-(rows|columns)/, 'grid-template-$1');
|
|
29
40
|
};
|
|
30
41
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Recursive part of changeRepeat
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
GridTemplate.prototype.walkRepeat = function walkRepeat(node) {
|
|
48
|
+
var fixed = [];
|
|
49
|
+
for (var _iterator = node.nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
|
50
|
+
var _ref;
|
|
51
|
+
|
|
52
|
+
if (_isArray) {
|
|
53
|
+
if (_i >= _iterator.length) break;
|
|
54
|
+
_ref = _iterator[_i++];
|
|
55
|
+
} else {
|
|
56
|
+
_i = _iterator.next();
|
|
57
|
+
if (_i.done) break;
|
|
58
|
+
_ref = _i.value;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
var i = _ref;
|
|
62
|
+
|
|
63
|
+
if (i.nodes) {
|
|
64
|
+
this.walkRepeat(i);
|
|
65
|
+
}
|
|
66
|
+
fixed.push(i);
|
|
67
|
+
if (i.type === 'function' && i.value === 'repeat') {
|
|
68
|
+
var first = i.nodes.shift();
|
|
69
|
+
if (first) {
|
|
70
|
+
var count = first.value;
|
|
71
|
+
i.nodes.shift();
|
|
72
|
+
i.value = '';
|
|
73
|
+
fixed.push({ type: 'word', value: '[' + count + ']' });
|
|
74
|
+
}
|
|
75
|
+
}
|
|
52
76
|
}
|
|
53
|
-
|
|
54
|
-
return node.nodes = fixed;
|
|
77
|
+
node.nodes = fixed;
|
|
55
78
|
};
|
|
56
79
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
80
|
+
/**
|
|
81
|
+
* IE repeating syntax
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
GridTemplate.prototype.changeRepeat = function changeRepeat(value) {
|
|
86
|
+
var ast = parser(value);
|
|
87
|
+
this.walkRepeat(ast);
|
|
88
|
+
return ast.toString();
|
|
62
89
|
};
|
|
63
90
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
91
|
+
/**
|
|
92
|
+
* Change repeating syntax for IE
|
|
93
|
+
*/
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
GridTemplate.prototype.set = function set(decl, prefix) {
|
|
97
|
+
if (prefix === '-ms-' && decl.value.indexOf('repeat(') !== -1) {
|
|
98
|
+
decl.value = this.changeRepeat(decl.value);
|
|
99
|
+
}
|
|
100
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
69
101
|
};
|
|
70
102
|
|
|
71
103
|
return GridTemplate;
|
|
104
|
+
}(Declaration);
|
|
72
105
|
|
|
73
|
-
|
|
106
|
+
Object.defineProperty(GridTemplate, 'names', {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
writable: true,
|
|
109
|
+
value: ['grid-template-rows', 'grid-template-columns', 'grid-rows', 'grid-columns']
|
|
110
|
+
});
|
|
74
111
|
|
|
75
|
-
module.exports = GridTemplate;
|
|
76
112
|
|
|
77
|
-
|
|
113
|
+
module.exports = GridTemplate;
|