autoprefixer 9.8.7 → 10.0.2
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 +999 -0
- package/README.md +0 -3
- package/bin/autoprefixer +11 -11
- package/data/prefixes.js +799 -545
- package/lib/at-rule.js +23 -50
- package/lib/autoprefixer.js +108 -97
- package/lib/brackets.js +31 -44
- package/lib/browsers.js +54 -71
- package/lib/declaration.js +122 -178
- package/lib/hacks/align-content.js +24 -54
- package/lib/hacks/align-items.js +23 -53
- package/lib/hacks/align-self.js +32 -60
- package/lib/hacks/animation.js +11 -29
- package/lib/hacks/appearance.js +19 -35
- package/lib/hacks/backdrop-filter.js +16 -31
- package/lib/hacks/background-clip.js +19 -36
- package/lib/hacks/background-size.js +16 -31
- package/lib/hacks/block-logical.js +28 -36
- package/lib/hacks/border-image.js +9 -27
- package/lib/hacks/border-radius.js +22 -44
- package/lib/hacks/break-props.js +38 -51
- package/lib/hacks/color-adjust.js +11 -30
- package/lib/hacks/cross-fade.js +29 -48
- package/lib/hacks/display-flex.js +32 -61
- package/lib/hacks/display-grid.js +12 -32
- package/lib/hacks/filter-value.js +8 -25
- package/lib/hacks/filter.js +13 -27
- package/lib/hacks/flex-basis.js +21 -54
- package/lib/hacks/flex-direction.js +41 -77
- package/lib/hacks/flex-flow.js +33 -61
- package/lib/hacks/flex-grow.js +16 -43
- package/lib/hacks/flex-shrink.js +21 -54
- package/lib/hacks/flex-spec.js +7 -10
- package/lib/hacks/flex-wrap.js +11 -32
- package/lib/hacks/flex.js +27 -58
- package/lib/hacks/fullscreen.js +10 -30
- package/lib/hacks/gradient.js +240 -330
- package/lib/hacks/grid-area.js +25 -43
- package/lib/hacks/grid-column-align.js +14 -34
- package/lib/hacks/grid-end.js +30 -45
- package/lib/hacks/grid-row-align.js +14 -34
- package/lib/hacks/grid-row-column.js +20 -39
- package/lib/hacks/grid-rows-columns.js +75 -99
- package/lib/hacks/grid-start.js +17 -39
- package/lib/hacks/grid-template-areas.js +59 -76
- package/lib/hacks/grid-template.js +40 -61
- package/lib/hacks/grid-utils.js +686 -716
- package/lib/hacks/image-rendering.js +24 -47
- package/lib/hacks/image-set.js +10 -30
- package/lib/hacks/inline-logical.js +26 -32
- package/lib/hacks/intrinsic.js +40 -53
- package/lib/hacks/justify-content.js +26 -57
- package/lib/hacks/mask-border.js +28 -36
- package/lib/hacks/mask-composite.js +41 -57
- package/lib/hacks/order.js +22 -52
- package/lib/hacks/overscroll-behavior.js +16 -37
- package/lib/hacks/pixelated.js +16 -40
- package/lib/hacks/place-self.js +18 -41
- package/lib/hacks/placeholder-shown.js +9 -28
- package/lib/hacks/placeholder.js +15 -38
- package/lib/hacks/text-decoration-skip-ink.js +14 -29
- package/lib/hacks/text-decoration.js +20 -31
- package/lib/hacks/text-emphasis-position.js +9 -28
- package/lib/hacks/transform-decl.js +43 -69
- package/lib/hacks/user-select.js +19 -27
- package/lib/hacks/writing-mode.js +19 -36
- package/lib/info.js +63 -93
- package/lib/old-selector.js +39 -60
- package/lib/old-value.js +17 -25
- package/lib/prefixer.js +83 -110
- package/lib/prefixes.js +233 -336
- package/lib/processor.js +420 -416
- package/lib/resolution.js +62 -98
- package/lib/selector.js +91 -139
- package/lib/supports.js +194 -246
- package/lib/transition.js +170 -265
- package/lib/utils.js +49 -72
- package/lib/value.js +77 -116
- package/lib/vendor.js +14 -0
- package/package.json +23 -12
package/lib/hacks/cross-fade.js
CHANGED
|
@@ -1,54 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
let list = require('postcss').list
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
let Value = require('../value')
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var CrossFade = /*#__PURE__*/function (_Value) {
|
|
14
|
-
_inheritsLoose(CrossFade, _Value);
|
|
15
|
-
|
|
16
|
-
function CrossFade() {
|
|
17
|
-
return _Value.apply(this, arguments) || this;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
var _proto = CrossFade.prototype;
|
|
21
|
-
|
|
22
|
-
_proto.replace = function replace(string, prefix) {
|
|
23
|
-
var _this = this;
|
|
24
|
-
|
|
25
|
-
return list.space(string).map(function (value) {
|
|
26
|
-
if (value.slice(0, +_this.name.length + 1) !== _this.name + '(') {
|
|
27
|
-
return value;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
var close = value.lastIndexOf(')');
|
|
31
|
-
var after = value.slice(close + 1);
|
|
32
|
-
var args = value.slice(_this.name.length + 1, close);
|
|
33
|
-
|
|
34
|
-
if (prefix === '-webkit-') {
|
|
35
|
-
var match = args.match(/\d*.?\d+%?/);
|
|
36
|
-
|
|
37
|
-
if (match) {
|
|
38
|
-
args = args.slice(match[0].length).trim();
|
|
39
|
-
args += ", " + match[0];
|
|
40
|
-
} else {
|
|
41
|
-
args += ', 0.5';
|
|
5
|
+
class CrossFade extends Value {
|
|
6
|
+
replace (string, prefix) {
|
|
7
|
+
return list
|
|
8
|
+
.space(string)
|
|
9
|
+
.map(value => {
|
|
10
|
+
if (value.slice(0, +this.name.length + 1) !== this.name + '(') {
|
|
11
|
+
return value
|
|
42
12
|
}
|
|
43
|
-
}
|
|
44
13
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
14
|
+
let close = value.lastIndexOf(')')
|
|
15
|
+
let after = value.slice(close + 1)
|
|
16
|
+
let args = value.slice(this.name.length + 1, close)
|
|
17
|
+
|
|
18
|
+
if (prefix === '-webkit-') {
|
|
19
|
+
let match = args.match(/\d*.?\d+%?/)
|
|
20
|
+
if (match) {
|
|
21
|
+
args = args.slice(match[0].length).trim()
|
|
22
|
+
args += `, ${match[0]}`
|
|
23
|
+
} else {
|
|
24
|
+
args += ', 0.5'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return prefix + this.name + '(' + args + ')' + after
|
|
28
|
+
})
|
|
29
|
+
.join(' ')
|
|
30
|
+
}
|
|
31
|
+
}
|
|
51
32
|
|
|
52
|
-
|
|
33
|
+
CrossFade.names = ['cross-fade']
|
|
53
34
|
|
|
54
|
-
module.exports = CrossFade
|
|
35
|
+
module.exports = CrossFade
|
|
@@ -1,94 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
|
|
6
|
-
|
|
7
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
|
|
9
|
-
var flexSpec = require('./flex-spec');
|
|
10
|
-
|
|
11
|
-
var OldValue = require('../old-value');
|
|
12
|
-
|
|
13
|
-
var Value = require('../value');
|
|
14
|
-
|
|
15
|
-
var DisplayFlex = /*#__PURE__*/function (_Value) {
|
|
16
|
-
_inheritsLoose(DisplayFlex, _Value);
|
|
17
|
-
|
|
18
|
-
function DisplayFlex(name, prefixes) {
|
|
19
|
-
var _this;
|
|
20
|
-
|
|
21
|
-
_this = _Value.call(this, name, prefixes) || this;
|
|
1
|
+
let flexSpec = require('./flex-spec')
|
|
2
|
+
let OldValue = require('../old-value')
|
|
3
|
+
let Value = require('../value')
|
|
22
4
|
|
|
5
|
+
class DisplayFlex extends Value {
|
|
6
|
+
constructor (name, prefixes) {
|
|
7
|
+
super(name, prefixes)
|
|
23
8
|
if (name === 'display-flex') {
|
|
24
|
-
|
|
9
|
+
this.name = 'flex'
|
|
25
10
|
}
|
|
26
|
-
|
|
27
|
-
return _this;
|
|
28
11
|
}
|
|
12
|
+
|
|
29
13
|
/**
|
|
30
14
|
* Faster check for flex value
|
|
31
15
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var _proto = DisplayFlex.prototype;
|
|
35
|
-
|
|
36
|
-
_proto.check = function check(decl) {
|
|
37
|
-
return decl.prop === 'display' && decl.value === this.name;
|
|
16
|
+
check (decl) {
|
|
17
|
+
return decl.prop === 'display' && decl.value === this.name
|
|
38
18
|
}
|
|
19
|
+
|
|
39
20
|
/**
|
|
40
21
|
* Return value by spec
|
|
41
22
|
*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var spec, value;
|
|
46
|
-
|
|
47
|
-
var _flexSpec = flexSpec(prefix);
|
|
48
|
-
|
|
49
|
-
spec = _flexSpec[0];
|
|
50
|
-
prefix = _flexSpec[1];
|
|
23
|
+
prefixed (prefix) {
|
|
24
|
+
let spec, value
|
|
25
|
+
;[spec, prefix] = flexSpec(prefix)
|
|
51
26
|
|
|
52
27
|
if (spec === 2009) {
|
|
53
28
|
if (this.name === 'flex') {
|
|
54
|
-
value = 'box'
|
|
29
|
+
value = 'box'
|
|
55
30
|
} else {
|
|
56
|
-
value = 'inline-box'
|
|
31
|
+
value = 'inline-box'
|
|
57
32
|
}
|
|
58
33
|
} else if (spec === 2012) {
|
|
59
34
|
if (this.name === 'flex') {
|
|
60
|
-
value = 'flexbox'
|
|
35
|
+
value = 'flexbox'
|
|
61
36
|
} else {
|
|
62
|
-
value = 'inline-flexbox'
|
|
37
|
+
value = 'inline-flexbox'
|
|
63
38
|
}
|
|
64
39
|
} else if (spec === 'final') {
|
|
65
|
-
value = this.name
|
|
40
|
+
value = this.name
|
|
66
41
|
}
|
|
67
42
|
|
|
68
|
-
return prefix + value
|
|
43
|
+
return prefix + value
|
|
69
44
|
}
|
|
45
|
+
|
|
70
46
|
/**
|
|
71
47
|
* Add prefix to value depend on flebox spec version
|
|
72
48
|
*/
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
_proto.replace = function replace(string, prefix) {
|
|
76
|
-
return this.prefixed(prefix);
|
|
49
|
+
replace (string, prefix) {
|
|
50
|
+
return this.prefixed(prefix)
|
|
77
51
|
}
|
|
52
|
+
|
|
78
53
|
/**
|
|
79
54
|
* Change value for old specs
|
|
80
55
|
*/
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
return DisplayFlex;
|
|
90
|
-
}(Value);
|
|
56
|
+
old (prefix) {
|
|
57
|
+
let prefixed = this.prefixed(prefix)
|
|
58
|
+
if (!prefixed) return undefined
|
|
59
|
+
return new OldValue(this.name, prefixed)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
91
62
|
|
|
92
|
-
|
|
63
|
+
DisplayFlex.names = ['display-flex', 'inline-flex']
|
|
93
64
|
|
|
94
|
-
module.exports = DisplayFlex
|
|
65
|
+
module.exports = DisplayFlex
|
|
@@ -1,41 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
|
|
4
|
-
|
|
5
|
-
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
|
|
6
|
-
|
|
7
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
|
|
9
|
-
var Value = require('../value');
|
|
10
|
-
|
|
11
|
-
var DisplayGrid = /*#__PURE__*/function (_Value) {
|
|
12
|
-
_inheritsLoose(DisplayGrid, _Value);
|
|
13
|
-
|
|
14
|
-
function DisplayGrid(name, prefixes) {
|
|
15
|
-
var _this;
|
|
16
|
-
|
|
17
|
-
_this = _Value.call(this, name, prefixes) || this;
|
|
1
|
+
let Value = require('../value')
|
|
18
2
|
|
|
3
|
+
class DisplayGrid extends Value {
|
|
4
|
+
constructor (name, prefixes) {
|
|
5
|
+
super(name, prefixes)
|
|
19
6
|
if (name === 'display-grid') {
|
|
20
|
-
|
|
7
|
+
this.name = 'grid'
|
|
21
8
|
}
|
|
22
|
-
|
|
23
|
-
return _this;
|
|
24
9
|
}
|
|
10
|
+
|
|
25
11
|
/**
|
|
26
12
|
* Faster check for flex value
|
|
27
13
|
*/
|
|
14
|
+
check (decl) {
|
|
15
|
+
return decl.prop === 'display' && decl.value === this.name
|
|
16
|
+
}
|
|
17
|
+
}
|
|
28
18
|
|
|
19
|
+
DisplayGrid.names = ['display-grid', 'inline-grid']
|
|
29
20
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
_proto.check = function check(decl) {
|
|
33
|
-
return decl.prop === 'display' && decl.value === this.name;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
return DisplayGrid;
|
|
37
|
-
}(Value);
|
|
38
|
-
|
|
39
|
-
_defineProperty(DisplayGrid, "names", ['display-grid', 'inline-grid']);
|
|
40
|
-
|
|
41
|
-
module.exports = DisplayGrid;
|
|
21
|
+
module.exports = DisplayGrid
|
|
@@ -1,31 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
|
|
4
|
-
|
|
5
|
-
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
|
|
6
|
-
|
|
7
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
|
|
9
|
-
var Value = require('../value');
|
|
10
|
-
|
|
11
|
-
var FilterValue = /*#__PURE__*/function (_Value) {
|
|
12
|
-
_inheritsLoose(FilterValue, _Value);
|
|
13
|
-
|
|
14
|
-
function FilterValue(name, prefixes) {
|
|
15
|
-
var _this;
|
|
16
|
-
|
|
17
|
-
_this = _Value.call(this, name, prefixes) || this;
|
|
1
|
+
let Value = require('../value')
|
|
18
2
|
|
|
3
|
+
class FilterValue extends Value {
|
|
4
|
+
constructor (name, prefixes) {
|
|
5
|
+
super(name, prefixes)
|
|
19
6
|
if (name === 'filter-function') {
|
|
20
|
-
|
|
7
|
+
this.name = 'filter'
|
|
21
8
|
}
|
|
22
|
-
|
|
23
|
-
return _this;
|
|
24
9
|
}
|
|
10
|
+
}
|
|
25
11
|
|
|
26
|
-
|
|
27
|
-
}(Value);
|
|
28
|
-
|
|
29
|
-
_defineProperty(FilterValue, "names", ['filter', 'filter-function']);
|
|
12
|
+
FilterValue.names = ['filter', 'filter-function']
|
|
30
13
|
|
|
31
|
-
module.exports = FilterValue
|
|
14
|
+
module.exports = FilterValue
|
package/lib/hacks/filter.js
CHANGED
|
@@ -1,33 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
|
|
4
|
-
|
|
5
|
-
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
|
|
6
|
-
|
|
7
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
|
|
9
|
-
var Declaration = require('../declaration');
|
|
10
|
-
|
|
11
|
-
var Filter = /*#__PURE__*/function (_Declaration) {
|
|
12
|
-
_inheritsLoose(Filter, _Declaration);
|
|
13
|
-
|
|
14
|
-
function Filter() {
|
|
15
|
-
return _Declaration.apply(this, arguments) || this;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
var _proto = Filter.prototype;
|
|
1
|
+
let Declaration = require('../declaration')
|
|
19
2
|
|
|
3
|
+
class Filter extends Declaration {
|
|
20
4
|
/**
|
|
21
5
|
* Check is it Internet Explorer filter
|
|
22
6
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
7
|
+
check (decl) {
|
|
8
|
+
let v = decl.value
|
|
9
|
+
return (
|
|
10
|
+
!v.toLowerCase().includes('alpha(') &&
|
|
11
|
+
!v.includes('DXImageTransform.Microsoft') &&
|
|
12
|
+
!v.includes('data:image/svg+xml')
|
|
13
|
+
)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
30
16
|
|
|
31
|
-
|
|
17
|
+
Filter.names = ['filter']
|
|
32
18
|
|
|
33
|
-
module.exports = Filter
|
|
19
|
+
module.exports = Filter
|
package/lib/hacks/flex-basis.js
CHANGED
|
@@ -1,72 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
|
|
4
|
-
|
|
5
|
-
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
|
|
6
|
-
|
|
7
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
|
|
9
|
-
var flexSpec = require('./flex-spec');
|
|
10
|
-
|
|
11
|
-
var Declaration = require('../declaration');
|
|
12
|
-
|
|
13
|
-
var FlexBasis = /*#__PURE__*/function (_Declaration) {
|
|
14
|
-
_inheritsLoose(FlexBasis, _Declaration);
|
|
15
|
-
|
|
16
|
-
function FlexBasis() {
|
|
17
|
-
return _Declaration.apply(this, arguments) || this;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
var _proto = FlexBasis.prototype;
|
|
1
|
+
let flexSpec = require('./flex-spec')
|
|
2
|
+
let Declaration = require('../declaration')
|
|
21
3
|
|
|
4
|
+
class FlexBasis extends Declaration {
|
|
22
5
|
/**
|
|
23
6
|
* Return property name by final spec
|
|
24
7
|
*/
|
|
25
|
-
|
|
26
|
-
return 'flex-basis'
|
|
8
|
+
normalize () {
|
|
9
|
+
return 'flex-basis'
|
|
27
10
|
}
|
|
11
|
+
|
|
28
12
|
/**
|
|
29
13
|
* Return flex property for 2012 spec
|
|
30
14
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var spec;
|
|
35
|
-
|
|
36
|
-
var _flexSpec = flexSpec(prefix);
|
|
37
|
-
|
|
38
|
-
spec = _flexSpec[0];
|
|
39
|
-
prefix = _flexSpec[1];
|
|
40
|
-
|
|
15
|
+
prefixed (prop, prefix) {
|
|
16
|
+
let spec
|
|
17
|
+
;[spec, prefix] = flexSpec(prefix)
|
|
41
18
|
if (spec === 2012) {
|
|
42
|
-
return prefix + 'flex-preferred-size'
|
|
19
|
+
return prefix + 'flex-preferred-size'
|
|
43
20
|
}
|
|
44
|
-
|
|
45
|
-
return _Declaration.prototype.prefixed.call(this, prop, prefix);
|
|
21
|
+
return super.prefixed(prop, prefix)
|
|
46
22
|
}
|
|
23
|
+
|
|
47
24
|
/**
|
|
48
25
|
* Ignore 2009 spec and use flex property for 2012
|
|
49
26
|
*/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
var spec;
|
|
54
|
-
|
|
55
|
-
var _flexSpec2 = flexSpec(prefix);
|
|
56
|
-
|
|
57
|
-
spec = _flexSpec2[0];
|
|
58
|
-
prefix = _flexSpec2[1];
|
|
59
|
-
|
|
27
|
+
set (decl, prefix) {
|
|
28
|
+
let spec
|
|
29
|
+
;[spec, prefix] = flexSpec(prefix)
|
|
60
30
|
if (spec === 2012 || spec === 'final') {
|
|
61
|
-
return
|
|
31
|
+
return super.set(decl, prefix)
|
|
62
32
|
}
|
|
33
|
+
return undefined
|
|
34
|
+
}
|
|
35
|
+
}
|
|
63
36
|
|
|
64
|
-
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
return FlexBasis;
|
|
68
|
-
}(Declaration);
|
|
69
|
-
|
|
70
|
-
_defineProperty(FlexBasis, "names", ['flex-basis', 'flex-preferred-size']);
|
|
37
|
+
FlexBasis.names = ['flex-basis', 'flex-preferred-size']
|
|
71
38
|
|
|
72
|
-
module.exports = FlexBasis
|
|
39
|
+
module.exports = FlexBasis
|
|
@@ -1,108 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
|
|
4
|
-
|
|
5
|
-
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
|
|
6
|
-
|
|
7
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
|
|
9
|
-
var flexSpec = require('./flex-spec');
|
|
10
|
-
|
|
11
|
-
var Declaration = require('../declaration');
|
|
12
|
-
|
|
13
|
-
var FlexDirection = /*#__PURE__*/function (_Declaration) {
|
|
14
|
-
_inheritsLoose(FlexDirection, _Declaration);
|
|
15
|
-
|
|
16
|
-
function FlexDirection() {
|
|
17
|
-
return _Declaration.apply(this, arguments) || this;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
var _proto = FlexDirection.prototype;
|
|
1
|
+
let flexSpec = require('./flex-spec')
|
|
2
|
+
let Declaration = require('../declaration')
|
|
21
3
|
|
|
4
|
+
class FlexDirection extends Declaration {
|
|
22
5
|
/**
|
|
23
6
|
* Return property name by final spec
|
|
24
7
|
*/
|
|
25
|
-
|
|
26
|
-
return 'flex-direction'
|
|
8
|
+
normalize () {
|
|
9
|
+
return 'flex-direction'
|
|
27
10
|
}
|
|
11
|
+
|
|
28
12
|
/**
|
|
29
13
|
* Use two properties for 2009 spec
|
|
30
14
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var spec;
|
|
35
|
-
|
|
36
|
-
var _flexSpec = flexSpec(prefix);
|
|
37
|
-
|
|
38
|
-
spec = _flexSpec[0];
|
|
39
|
-
prefix = _flexSpec[1];
|
|
40
|
-
|
|
15
|
+
insert (decl, prefix, prefixes) {
|
|
16
|
+
let spec
|
|
17
|
+
;[spec, prefix] = flexSpec(prefix)
|
|
41
18
|
if (spec !== 2009) {
|
|
42
|
-
return
|
|
19
|
+
return super.insert(decl, prefix, prefixes)
|
|
43
20
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
21
|
+
let already = decl.parent.some(
|
|
22
|
+
i =>
|
|
23
|
+
i.prop === prefix + 'box-orient' || i.prop === prefix + 'box-direction'
|
|
24
|
+
)
|
|
49
25
|
if (already) {
|
|
50
|
-
return undefined
|
|
26
|
+
return undefined
|
|
51
27
|
}
|
|
52
28
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
29
|
+
let v = decl.value
|
|
30
|
+
let orient, dir
|
|
56
31
|
if (v === 'inherit' || v === 'initial' || v === 'unset') {
|
|
57
|
-
orient = v
|
|
58
|
-
dir = v
|
|
32
|
+
orient = v
|
|
33
|
+
dir = v
|
|
59
34
|
} else {
|
|
60
|
-
orient = v.includes('row') ? 'horizontal' : 'vertical'
|
|
61
|
-
dir = v.includes('reverse') ? 'reverse' : 'normal'
|
|
35
|
+
orient = v.includes('row') ? 'horizontal' : 'vertical'
|
|
36
|
+
dir = v.includes('reverse') ? 'reverse' : 'normal'
|
|
62
37
|
}
|
|
63
38
|
|
|
64
|
-
|
|
65
|
-
cloned.prop = prefix + 'box-orient'
|
|
66
|
-
cloned.value = orient
|
|
67
|
-
|
|
39
|
+
let cloned = this.clone(decl)
|
|
40
|
+
cloned.prop = prefix + 'box-orient'
|
|
41
|
+
cloned.value = orient
|
|
68
42
|
if (this.needCascade(decl)) {
|
|
69
|
-
cloned.raws.before = this.calcBefore(prefixes, decl, prefix)
|
|
43
|
+
cloned.raws.before = this.calcBefore(prefixes, decl, prefix)
|
|
70
44
|
}
|
|
45
|
+
decl.parent.insertBefore(decl, cloned)
|
|
71
46
|
|
|
72
|
-
|
|
73
|
-
cloned =
|
|
74
|
-
cloned.
|
|
75
|
-
cloned.value = dir;
|
|
76
|
-
|
|
47
|
+
cloned = this.clone(decl)
|
|
48
|
+
cloned.prop = prefix + 'box-direction'
|
|
49
|
+
cloned.value = dir
|
|
77
50
|
if (this.needCascade(decl)) {
|
|
78
|
-
cloned.raws.before = this.calcBefore(prefixes, decl, prefix)
|
|
51
|
+
cloned.raws.before = this.calcBefore(prefixes, decl, prefix)
|
|
79
52
|
}
|
|
80
|
-
|
|
81
|
-
return decl.parent.insertBefore(decl, cloned);
|
|
53
|
+
return decl.parent.insertBefore(decl, cloned)
|
|
82
54
|
}
|
|
55
|
+
|
|
83
56
|
/**
|
|
84
57
|
* Clean two properties for 2009 spec
|
|
85
58
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
var spec;
|
|
90
|
-
|
|
91
|
-
var _flexSpec2 = flexSpec(prefix);
|
|
92
|
-
|
|
93
|
-
spec = _flexSpec2[0];
|
|
94
|
-
prefix = _flexSpec2[1];
|
|
95
|
-
|
|
59
|
+
old (prop, prefix) {
|
|
60
|
+
let spec
|
|
61
|
+
;[spec, prefix] = flexSpec(prefix)
|
|
96
62
|
if (spec === 2009) {
|
|
97
|
-
return [prefix + 'box-orient', prefix + 'box-direction']
|
|
63
|
+
return [prefix + 'box-orient', prefix + 'box-direction']
|
|
98
64
|
} else {
|
|
99
|
-
return
|
|
65
|
+
return super.old(prop, prefix)
|
|
100
66
|
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return FlexDirection;
|
|
104
|
-
}(Declaration);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
105
69
|
|
|
106
|
-
|
|
70
|
+
FlexDirection.names = ['flex-direction', 'box-direction', 'box-orient']
|
|
107
71
|
|
|
108
|
-
module.exports = FlexDirection
|
|
72
|
+
module.exports = FlexDirection
|