autoprefixer 6.7.7 → 7.1.1
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 +9 -15
- 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 +73 -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 +53 -13
- package/lib/hacks/justify-items.js +0 -31
- package/lib/hacks/stretch.js +0 -45
|
@@ -1,71 +1,103 @@
|
|
|
1
|
-
|
|
2
|
-
var Declaration, FlexDirection, flexSpec,
|
|
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 flexSpec = require('./flex-spec');
|
|
10
|
+
var Declaration = require('../declaration');
|
|
11
|
+
|
|
12
|
+
var FlexDirection = function (_Declaration) {
|
|
13
|
+
_inherits(FlexDirection, _Declaration);
|
|
12
14
|
|
|
13
15
|
function FlexDirection() {
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
+
_classCallCheck(this, FlexDirection);
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
19
|
+
}
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Return property name by final spec
|
|
23
|
+
*/
|
|
24
|
+
FlexDirection.prototype.normalize = function normalize() {
|
|
25
|
+
return 'flex-direction';
|
|
21
26
|
};
|
|
22
27
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Use two properties for 2009 spec
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
FlexDirection.prototype.insert = function insert(decl, prefix, prefixes) {
|
|
34
|
+
var spec = void 0;
|
|
35
|
+
|
|
36
|
+
var _flexSpec = flexSpec(prefix);
|
|
37
|
+
|
|
38
|
+
spec = _flexSpec[0];
|
|
39
|
+
prefix = _flexSpec[1];
|
|
40
|
+
|
|
41
|
+
if (spec !== 2009) {
|
|
42
|
+
return _Declaration.prototype.insert.call(this, decl, prefix, prefixes);
|
|
43
|
+
} else {
|
|
44
|
+
var already = decl.parent.some(function (i) {
|
|
45
|
+
return i.prop === prefix + 'box-orient' || i.prop === prefix + 'box-direction';
|
|
46
|
+
});
|
|
47
|
+
if (already) {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
var value = decl.value;
|
|
52
|
+
var orient = value.indexOf('row') !== -1 ? 'horizontal' : 'vertical';
|
|
53
|
+
var dir = value.indexOf('reverse') !== -1 ? 'reverse' : 'normal';
|
|
54
|
+
|
|
55
|
+
var cloned = this.clone(decl);
|
|
56
|
+
cloned.prop = prefix + 'box-orient';
|
|
57
|
+
cloned.value = orient;
|
|
58
|
+
if (this.needCascade(decl)) {
|
|
59
|
+
cloned.raws.before = this.calcBefore(prefixes, decl, prefix);
|
|
60
|
+
}
|
|
61
|
+
decl.parent.insertBefore(decl, cloned);
|
|
62
|
+
|
|
63
|
+
cloned = this.clone(decl);
|
|
64
|
+
cloned.prop = prefix + 'box-direction';
|
|
65
|
+
cloned.value = dir;
|
|
66
|
+
if (this.needCascade(decl)) {
|
|
67
|
+
cloned.raws.before = this.calcBefore(prefixes, decl, prefix);
|
|
68
|
+
}
|
|
69
|
+
return decl.parent.insertBefore(decl, cloned);
|
|
50
70
|
}
|
|
51
|
-
return decl.parent.insertBefore(decl, cloned);
|
|
52
|
-
}
|
|
53
71
|
};
|
|
54
72
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Clean two properties for 2009 spec
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
FlexDirection.prototype.old = function old(prop, prefix) {
|
|
79
|
+
var spec = void 0;
|
|
80
|
+
|
|
81
|
+
var _flexSpec2 = flexSpec(prefix);
|
|
82
|
+
|
|
83
|
+
spec = _flexSpec2[0];
|
|
84
|
+
prefix = _flexSpec2[1];
|
|
85
|
+
|
|
86
|
+
if (spec === 2009) {
|
|
87
|
+
return [prefix + 'box-orient', prefix + 'box-direction'];
|
|
88
|
+
} else {
|
|
89
|
+
return _Declaration.prototype.old.call(this, prop, prefix);
|
|
90
|
+
}
|
|
63
91
|
};
|
|
64
92
|
|
|
65
93
|
return FlexDirection;
|
|
94
|
+
}(Declaration);
|
|
66
95
|
|
|
67
|
-
|
|
96
|
+
Object.defineProperty(FlexDirection, 'names', {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
writable: true,
|
|
99
|
+
value: ['flex-direction', 'box-direction', 'box-orient']
|
|
100
|
+
});
|
|
68
101
|
|
|
69
|
-
module.exports = FlexDirection;
|
|
70
102
|
|
|
71
|
-
|
|
103
|
+
module.exports = FlexDirection;
|
package/lib/hacks/flex-flow.js
CHANGED
|
@@ -1,63 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
var Declaration, FlexFlow, flexSpec,
|
|
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 flexSpec = require('./flex-spec');
|
|
10
|
+
var Declaration = require('../declaration');
|
|
11
|
+
|
|
12
|
+
var FlexFlow = function (_Declaration) {
|
|
13
|
+
_inherits(FlexFlow, _Declaration);
|
|
12
14
|
|
|
13
15
|
function FlexFlow() {
|
|
14
|
-
|
|
16
|
+
_classCallCheck(this, FlexFlow);
|
|
17
|
+
|
|
18
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
15
19
|
}
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Use two properties for 2009 spec
|
|
23
|
+
*/
|
|
24
|
+
FlexFlow.prototype.insert = function insert(decl, prefix, prefixes) {
|
|
25
|
+
var spec = void 0;
|
|
26
|
+
|
|
27
|
+
var _flexSpec = flexSpec(prefix);
|
|
28
|
+
|
|
29
|
+
spec = _flexSpec[0];
|
|
30
|
+
prefix = _flexSpec[1];
|
|
31
|
+
|
|
32
|
+
if (spec !== 2009) {
|
|
33
|
+
return _Declaration.prototype.insert.call(this, decl, prefix, prefixes);
|
|
34
|
+
} else {
|
|
35
|
+
var values = decl.value.split(/\s+/).filter(function (i) {
|
|
36
|
+
return i !== 'wrap' && i !== 'nowrap' && 'wrap-reverse';
|
|
37
|
+
});
|
|
38
|
+
if (values.length === 0) {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
var already = decl.parent.some(function (i) {
|
|
43
|
+
return i.prop === prefix + 'box-orient' || i.prop === prefix + 'box-direction';
|
|
44
|
+
});
|
|
45
|
+
if (already) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var value = values[0];
|
|
50
|
+
var orient = value.indexOf('row') !== -1 ? 'horizontal' : 'vertical';
|
|
51
|
+
var dir = value.indexOf('reverse') !== -1 ? 'reverse' : 'normal';
|
|
52
|
+
|
|
53
|
+
var cloned = this.clone(decl);
|
|
54
|
+
cloned.prop = prefix + 'box-orient';
|
|
55
|
+
cloned.value = orient;
|
|
56
|
+
if (this.needCascade(decl)) {
|
|
57
|
+
cloned.raws.before = this.calcBefore(prefixes, decl, prefix);
|
|
58
|
+
}
|
|
59
|
+
decl.parent.insertBefore(decl, cloned);
|
|
60
|
+
|
|
61
|
+
cloned = this.clone(decl);
|
|
62
|
+
cloned.prop = prefix + 'box-direction';
|
|
63
|
+
cloned.value = dir;
|
|
64
|
+
if (this.needCascade(decl)) {
|
|
65
|
+
cloned.raws.before = this.calcBefore(prefixes, decl, prefix);
|
|
66
|
+
}
|
|
67
|
+
return decl.parent.insertBefore(decl, cloned);
|
|
52
68
|
}
|
|
53
|
-
return decl.parent.insertBefore(decl, cloned);
|
|
54
|
-
}
|
|
55
69
|
};
|
|
56
70
|
|
|
57
71
|
return FlexFlow;
|
|
72
|
+
}(Declaration);
|
|
58
73
|
|
|
59
|
-
|
|
74
|
+
Object.defineProperty(FlexFlow, 'names', {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
writable: true,
|
|
77
|
+
value: ['flex-flow', 'box-direction', 'box-orient']
|
|
78
|
+
});
|
|
60
79
|
|
|
61
|
-
module.exports = FlexFlow;
|
|
62
80
|
|
|
63
|
-
|
|
81
|
+
module.exports = FlexFlow;
|
package/lib/hacks/flex-grow.js
CHANGED
|
@@ -1,41 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
var Declaration, Flex, flexSpec,
|
|
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 flexSpec = require('./flex-spec');
|
|
10
|
+
var Declaration = require('../declaration');
|
|
11
|
+
|
|
12
|
+
var Flex = function (_Declaration) {
|
|
13
|
+
_inherits(Flex, _Declaration);
|
|
12
14
|
|
|
13
15
|
function Flex() {
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
+
_classCallCheck(this, Flex);
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
19
|
+
}
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Return property name by final spec
|
|
23
|
+
*/
|
|
24
|
+
Flex.prototype.normalize = function normalize() {
|
|
25
|
+
return 'flex';
|
|
21
26
|
};
|
|
22
27
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Return flex property for 2009 and 2012 specs
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
Flex.prototype.prefixed = function prefixed(prop, prefix) {
|
|
34
|
+
var spec = void 0;
|
|
35
|
+
|
|
36
|
+
var _flexSpec = flexSpec(prefix);
|
|
37
|
+
|
|
38
|
+
spec = _flexSpec[0];
|
|
39
|
+
prefix = _flexSpec[1];
|
|
40
|
+
|
|
41
|
+
if (spec === 2009) {
|
|
42
|
+
return prefix + 'box-flex';
|
|
43
|
+
} else if (spec === 2012) {
|
|
44
|
+
return prefix + 'flex-positive';
|
|
45
|
+
} else {
|
|
46
|
+
return _Declaration.prototype.prefixed.call(this, prop, prefix);
|
|
47
|
+
}
|
|
33
48
|
};
|
|
34
49
|
|
|
35
50
|
return Flex;
|
|
51
|
+
}(Declaration);
|
|
36
52
|
|
|
37
|
-
|
|
53
|
+
Object.defineProperty(Flex, 'names', {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
writable: true,
|
|
56
|
+
value: ['flex-grow', 'flex-positive']
|
|
57
|
+
});
|
|
38
58
|
|
|
39
|
-
module.exports = Flex;
|
|
40
59
|
|
|
41
|
-
|
|
60
|
+
module.exports = Flex;
|
package/lib/hacks/flex-shrink.js
CHANGED
|
@@ -1,47 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
var Declaration, FlexShrink, flexSpec,
|
|
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 flexSpec = require('./flex-spec');
|
|
10
|
+
var Declaration = require('../declaration');
|
|
11
|
+
|
|
12
|
+
var FlexShrink = function (_Declaration) {
|
|
13
|
+
_inherits(FlexShrink, _Declaration);
|
|
12
14
|
|
|
13
15
|
function FlexShrink() {
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
+
_classCallCheck(this, FlexShrink);
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
19
|
+
}
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Return property name by final spec
|
|
23
|
+
*/
|
|
24
|
+
FlexShrink.prototype.normalize = function normalize() {
|
|
25
|
+
return 'flex-shrink';
|
|
21
26
|
};
|
|
22
27
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Return flex property for 2012 spec
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
FlexShrink.prototype.prefixed = function prefixed(prop, prefix) {
|
|
34
|
+
var spec = void 0;
|
|
35
|
+
|
|
36
|
+
var _flexSpec = flexSpec(prefix);
|
|
37
|
+
|
|
38
|
+
spec = _flexSpec[0];
|
|
39
|
+
prefix = _flexSpec[1];
|
|
40
|
+
|
|
41
|
+
if (spec === 2012) {
|
|
42
|
+
return prefix + 'flex-negative';
|
|
43
|
+
} else {
|
|
44
|
+
return _Declaration.prototype.prefixed.call(this, prop, prefix);
|
|
45
|
+
}
|
|
31
46
|
};
|
|
32
47
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Ignore 2009 spec and use flex property for 2012
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
FlexShrink.prototype.set = function set(decl, prefix) {
|
|
54
|
+
var spec = void 0;
|
|
55
|
+
|
|
56
|
+
var _flexSpec2 = flexSpec(prefix);
|
|
57
|
+
|
|
58
|
+
spec = _flexSpec2[0];
|
|
59
|
+
prefix = _flexSpec2[1];
|
|
60
|
+
|
|
61
|
+
if (spec === 2012 || spec === 'final') {
|
|
62
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
39
65
|
};
|
|
40
66
|
|
|
41
67
|
return FlexShrink;
|
|
68
|
+
}(Declaration);
|
|
42
69
|
|
|
43
|
-
|
|
70
|
+
Object.defineProperty(FlexShrink, 'names', {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
writable: true,
|
|
73
|
+
value: ['flex-shrink', 'flex-negative']
|
|
74
|
+
});
|
|
44
75
|
|
|
45
|
-
module.exports = FlexShrink;
|
|
46
76
|
|
|
47
|
-
|
|
77
|
+
module.exports = FlexShrink;
|
package/lib/hacks/flex-spec.js
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Return flexbox spec versions by prefix
|
|
5
|
+
*/
|
|
6
|
+
module.exports = function (prefix) {
|
|
7
|
+
var spec = void 0;
|
|
8
|
+
if (prefix === '-webkit- 2009' || prefix === '-moz-') {
|
|
9
|
+
spec = 2009;
|
|
10
|
+
} else if (prefix === '-ms-') {
|
|
11
|
+
spec = 2012;
|
|
12
|
+
} else if (prefix === '-webkit-') {
|
|
13
|
+
spec = 'final';
|
|
14
|
+
}
|
|
15
|
+
|
|
5
16
|
if (prefix === '-webkit- 2009') {
|
|
6
|
-
|
|
17
|
+
prefix = '-webkit-';
|
|
7
18
|
}
|
|
8
|
-
return [spec, prefix];
|
|
9
|
-
};
|
|
10
19
|
|
|
11
|
-
|
|
20
|
+
return [spec, prefix];
|
|
21
|
+
};
|
package/lib/hacks/flex-values.js
CHANGED
|
@@ -1,37 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
var FlexValues, OldValue, Value,
|
|
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 OldValue = require('../old-value');
|
|
10
|
+
var Value = require('../value');
|
|
11
|
+
|
|
12
|
+
var FlexValues = function (_Value) {
|
|
13
|
+
_inherits(FlexValues, _Value);
|
|
12
14
|
|
|
13
15
|
function FlexValues() {
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
+
_classCallCheck(this, FlexValues);
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
return _possibleConstructorReturn(this, _Value.apply(this, arguments));
|
|
19
|
+
}
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Return prefixed property name
|
|
23
|
+
*/
|
|
24
|
+
FlexValues.prototype.prefixed = function prefixed(prefix) {
|
|
25
|
+
return this.all.prefixed(this.name, prefix);
|
|
21
26
|
};
|
|
22
27
|
|
|
23
|
-
|
|
24
|
-
|
|
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');
|
|
25
35
|
};
|
|
26
36
|
|
|
27
|
-
|
|
28
|
-
|
|
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));
|
|
29
44
|
};
|
|
30
45
|
|
|
31
46
|
return FlexValues;
|
|
47
|
+
}(Value);
|
|
32
48
|
|
|
33
|
-
|
|
49
|
+
Object.defineProperty(FlexValues, 'names', {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
writable: true,
|
|
52
|
+
value: ['flex', 'flex-grow', 'flex-shrink', 'flex-basis']
|
|
53
|
+
});
|
|
34
54
|
|
|
35
|
-
module.exports = FlexValues;
|
|
36
55
|
|
|
37
|
-
|
|
56
|
+
module.exports = FlexValues;
|