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
|
@@ -1,53 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
var Declaration, ImageRendering,
|
|
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 ImageRendering = function (_Declaration) {
|
|
12
|
+
_inherits(ImageRendering, _Declaration);
|
|
10
13
|
|
|
11
14
|
function ImageRendering() {
|
|
12
|
-
|
|
13
|
-
}
|
|
15
|
+
_classCallCheck(this, ImageRendering);
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
18
|
+
}
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Add hack only for crisp-edges
|
|
22
|
+
*/
|
|
23
|
+
ImageRendering.prototype.check = function check(decl) {
|
|
24
|
+
return decl.value === 'pixelated';
|
|
19
25
|
};
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Change property name for IE
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
ImageRendering.prototype.prefixed = function prefixed(prop, prefix) {
|
|
33
|
+
if (prefix === '-ms-') {
|
|
34
|
+
return '-ms-interpolation-mode';
|
|
35
|
+
} else {
|
|
36
|
+
return _Declaration.prototype.prefixed.call(this, prop, prefix);
|
|
37
|
+
}
|
|
27
38
|
};
|
|
28
39
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Change property and value for IE
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
ImageRendering.prototype.set = function set(decl, prefix) {
|
|
46
|
+
if (prefix === '-ms-') {
|
|
47
|
+
decl.prop = '-ms-interpolation-mode';
|
|
48
|
+
decl.value = 'nearest-neighbor';
|
|
49
|
+
return decl;
|
|
50
|
+
} else {
|
|
51
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
52
|
+
}
|
|
37
53
|
};
|
|
38
54
|
|
|
39
|
-
|
|
40
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Return property name by spec
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
ImageRendering.prototype.normalize = function normalize() {
|
|
61
|
+
return 'image-rendering';
|
|
41
62
|
};
|
|
42
63
|
|
|
43
|
-
|
|
44
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Warn on old value
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
ImageRendering.prototype.process = function process(node, result) {
|
|
70
|
+
return _Declaration.prototype.process.call(this, node, result);
|
|
45
71
|
};
|
|
46
72
|
|
|
47
73
|
return ImageRendering;
|
|
74
|
+
}(Declaration);
|
|
48
75
|
|
|
49
|
-
|
|
76
|
+
Object.defineProperty(ImageRendering, 'names', {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
writable: true,
|
|
79
|
+
value: ['image-rendering', 'interpolation-mode']
|
|
80
|
+
});
|
|
50
81
|
|
|
51
|
-
module.exports = ImageRendering;
|
|
52
82
|
|
|
53
|
-
|
|
83
|
+
module.exports = ImageRendering;
|
package/lib/hacks/image-set.js
CHANGED
|
@@ -1,33 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
var ImageSet, Value, list,
|
|
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 Value = require('../value');
|
|
10
|
+
|
|
11
|
+
var ImageSet = function (_Value) {
|
|
12
|
+
_inherits(ImageSet, _Value);
|
|
12
13
|
|
|
13
14
|
function ImageSet() {
|
|
14
|
-
|
|
15
|
-
}
|
|
15
|
+
_classCallCheck(this, ImageSet);
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
return _possibleConstructorReturn(this, _Value.apply(this, arguments));
|
|
18
|
+
}
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Use non-standard name for WebKit and Firefox
|
|
22
|
+
*/
|
|
23
|
+
ImageSet.prototype.replace = function replace(string, prefix) {
|
|
24
|
+
if (prefix === '-webkit-') {
|
|
25
|
+
return _Value.prototype.replace.call(this, string, prefix).replace(/("[^"]+"|'[^']+')(\s+\d+\w)/gi, 'url($1)$2');
|
|
26
|
+
} else {
|
|
27
|
+
return _Value.prototype.replace.call(this, string, prefix);
|
|
28
|
+
}
|
|
25
29
|
};
|
|
26
30
|
|
|
27
31
|
return ImageSet;
|
|
32
|
+
}(Value);
|
|
28
33
|
|
|
29
|
-
|
|
34
|
+
Object.defineProperty(ImageSet, 'names', {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
writable: true,
|
|
37
|
+
value: ['image-set']
|
|
38
|
+
});
|
|
30
39
|
|
|
31
|
-
module.exports = ImageSet;
|
|
32
40
|
|
|
33
|
-
|
|
41
|
+
module.exports = ImageSet;
|
|
@@ -1,31 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
var Declaration, InlineLogical,
|
|
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 InlineLogical = function (_Declaration) {
|
|
12
|
+
_inherits(InlineLogical, _Declaration);
|
|
10
13
|
|
|
11
14
|
function InlineLogical() {
|
|
12
|
-
|
|
13
|
-
}
|
|
15
|
+
_classCallCheck(this, InlineLogical);
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
18
|
+
}
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Use old syntax for -moz- and -webkit-
|
|
22
|
+
*/
|
|
23
|
+
InlineLogical.prototype.prefixed = function prefixed(prop, prefix) {
|
|
24
|
+
return prefix + prop.replace('-inline', '');
|
|
19
25
|
};
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Return property name by spec
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
InlineLogical.prototype.normalize = function normalize(prop) {
|
|
33
|
+
return prop.replace(/(margin|padding|border)-(start|end)/, '$1-inline-$2');
|
|
23
34
|
};
|
|
24
35
|
|
|
25
36
|
return InlineLogical;
|
|
37
|
+
}(Declaration);
|
|
26
38
|
|
|
27
|
-
|
|
39
|
+
Object.defineProperty(InlineLogical, 'names', {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
writable: true,
|
|
42
|
+
value: ['border-inline-start', 'border-inline-end', 'margin-inline-start', 'margin-inline-end', 'padding-inline-start', 'padding-inline-end', 'border-start', 'border-end', 'margin-start', 'margin-end', 'padding-start', 'padding-end']
|
|
43
|
+
});
|
|
28
44
|
|
|
29
|
-
module.exports = InlineLogical;
|
|
30
45
|
|
|
31
|
-
|
|
46
|
+
module.exports = InlineLogical;
|
|
@@ -0,0 +1,66 @@
|
|
|
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 OldValue = require('../old-value');
|
|
10
|
+
var Value = require('../value');
|
|
11
|
+
|
|
12
|
+
function _regexp(name) {
|
|
13
|
+
return new RegExp('(^|[\\s,(])(' + name + '($|[\\s),]))', 'gi');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
var Intrinsic = function (_Value) {
|
|
17
|
+
_inherits(Intrinsic, _Value);
|
|
18
|
+
|
|
19
|
+
function Intrinsic() {
|
|
20
|
+
_classCallCheck(this, Intrinsic);
|
|
21
|
+
|
|
22
|
+
return _possibleConstructorReturn(this, _Value.apply(this, arguments));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
Intrinsic.prototype.regexp = function regexp() {
|
|
26
|
+
if (!this.regexpCache) this.regexpCache = _regexp(this.name);
|
|
27
|
+
return this.regexpCache;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
Intrinsic.prototype.isStretch = function isStretch() {
|
|
31
|
+
return this.name === 'stretch' || this.name === 'fill' || this.name === 'fill-available';
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
Intrinsic.prototype.replace = function replace(string, prefix) {
|
|
35
|
+
if (prefix === '-moz-' && this.isStretch()) {
|
|
36
|
+
return string.replace(this.regexp(), '$1-moz-available$3');
|
|
37
|
+
} else if (prefix === '-webkit-' && this.isStretch()) {
|
|
38
|
+
return string.replace(this.regexp(), '$1-webkit-fill-available$3');
|
|
39
|
+
} else {
|
|
40
|
+
return _Value.prototype.replace.call(this, string, prefix);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
Intrinsic.prototype.old = function old(prefix) {
|
|
45
|
+
var prefixed = prefix + this.name;
|
|
46
|
+
if (this.isStretch()) {
|
|
47
|
+
if (prefix === '-moz-') {
|
|
48
|
+
prefixed = '-moz-available';
|
|
49
|
+
} else if (prefix === '-webkit-') {
|
|
50
|
+
prefixed = '-webkit-fill-available';
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return new OldValue(this.name, prefixed, prefixed, _regexp(prefixed));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return Intrinsic;
|
|
57
|
+
}(Value);
|
|
58
|
+
|
|
59
|
+
Object.defineProperty(Intrinsic, 'names', {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
writable: true,
|
|
62
|
+
value: ['max-content', 'min-content', 'fit-content', 'fill', 'fill-available', 'stretch']
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
module.exports = Intrinsic;
|
|
@@ -1,62 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
var Declaration, JustifyContent, 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 JustifyContent = function (_Declaration) {
|
|
13
|
+
_inherits(JustifyContent, _Declaration);
|
|
12
14
|
|
|
13
15
|
function JustifyContent() {
|
|
14
|
-
|
|
16
|
+
_classCallCheck(this, JustifyContent);
|
|
17
|
+
|
|
18
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
15
19
|
}
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Change property name for 2009 and 2012 specs
|
|
23
|
+
*/
|
|
24
|
+
JustifyContent.prototype.prefixed = function prefixed(prop, prefix) {
|
|
25
|
+
var spec = void 0;
|
|
18
26
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
'space-around': 'distribute'
|
|
24
|
-
};
|
|
27
|
+
var _flexSpec = flexSpec(prefix);
|
|
28
|
+
|
|
29
|
+
spec = _flexSpec[0];
|
|
30
|
+
prefix = _flexSpec[1];
|
|
25
31
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} else {
|
|
34
|
-
return JustifyContent.__super__.prefixed.apply(this, arguments);
|
|
35
|
-
}
|
|
32
|
+
if (spec === 2009) {
|
|
33
|
+
return prefix + 'box-pack';
|
|
34
|
+
} else if (spec === 2012) {
|
|
35
|
+
return prefix + 'flex-pack';
|
|
36
|
+
} else {
|
|
37
|
+
return _Declaration.prototype.prefixed.call(this, prop, prefix);
|
|
38
|
+
}
|
|
36
39
|
};
|
|
37
40
|
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Return property name by final spec
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
JustifyContent.prototype.normalize = function normalize() {
|
|
47
|
+
return 'justify-content';
|
|
40
48
|
};
|
|
41
49
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Change value for 2009 and 2012 specs
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
JustifyContent.prototype.set = function set(decl, prefix) {
|
|
56
|
+
var spec = flexSpec(prefix)[0];
|
|
57
|
+
if (spec === 2009 || spec === 2012) {
|
|
58
|
+
var value = JustifyContent.oldValues[decl.value] || decl.value;
|
|
59
|
+
decl.value = value;
|
|
60
|
+
if (spec !== 2009 || value !== 'distribute') {
|
|
61
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
62
|
+
}
|
|
63
|
+
} else if (spec === 'final') {
|
|
64
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
50
65
|
}
|
|
51
|
-
|
|
52
|
-
return JustifyContent.__super__.set.apply(this, arguments);
|
|
53
|
-
}
|
|
66
|
+
return undefined;
|
|
54
67
|
};
|
|
55
68
|
|
|
56
69
|
return JustifyContent;
|
|
70
|
+
}(Declaration);
|
|
57
71
|
|
|
58
|
-
|
|
72
|
+
Object.defineProperty(JustifyContent, 'names', {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
writable: true,
|
|
75
|
+
value: ['justify-content', 'flex-pack', 'box-pack']
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(JustifyContent, 'oldValues', {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
writable: true,
|
|
80
|
+
value: {
|
|
81
|
+
'flex-end': 'end',
|
|
82
|
+
'flex-start': 'start',
|
|
83
|
+
'space-between': 'justify',
|
|
84
|
+
'space-around': 'distribute'
|
|
85
|
+
}
|
|
86
|
+
});
|
|
59
87
|
|
|
60
|
-
module.exports = JustifyContent;
|
|
61
88
|
|
|
62
|
-
|
|
89
|
+
module.exports = JustifyContent;
|
package/lib/hacks/mask-border.js
CHANGED
|
@@ -1,35 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
var Declaration, MaskBorder,
|
|
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 MaskBorder = function (_Declaration) {
|
|
12
|
+
_inherits(MaskBorder, _Declaration);
|
|
10
13
|
|
|
11
14
|
function MaskBorder() {
|
|
12
|
-
|
|
13
|
-
}
|
|
15
|
+
_classCallCheck(this, MaskBorder);
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
18
|
+
}
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Return property name by final spec
|
|
22
|
+
*/
|
|
23
|
+
MaskBorder.prototype.normalize = function normalize() {
|
|
24
|
+
return this.name.replace('box-image', 'border');
|
|
19
25
|
};
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Return flex property for 2012 spec
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
MaskBorder.prototype.prefixed = function prefixed(prop, prefix) {
|
|
33
|
+
if (prefix === '-webkit-') {
|
|
34
|
+
return _Declaration.prototype.prefixed.call(this, prop, prefix).replace('border', 'box-image');
|
|
35
|
+
} else {
|
|
36
|
+
return _Declaration.prototype.prefixed.call(this, prop, prefix);
|
|
37
|
+
}
|
|
27
38
|
};
|
|
28
39
|
|
|
29
40
|
return MaskBorder;
|
|
41
|
+
}(Declaration);
|
|
30
42
|
|
|
31
|
-
|
|
43
|
+
Object.defineProperty(MaskBorder, 'names', {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
writable: true,
|
|
46
|
+
value: ['mask-border', 'mask-border-source', 'mask-border-slice', 'mask-border-width', 'mask-border-outset', 'mask-border-repeat', 'mask-box-image', 'mask-box-image-source', 'mask-box-image-slice', 'mask-box-image-width', 'mask-box-image-outset', 'mask-box-image-repeat']
|
|
47
|
+
});
|
|
32
48
|
|
|
33
|
-
module.exports = MaskBorder;
|
|
34
49
|
|
|
35
|
-
|
|
50
|
+
module.exports = MaskBorder;
|
package/lib/hacks/order.js
CHANGED
|
@@ -1,52 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
var Declaration, Order, 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 Order = function (_Declaration) {
|
|
13
|
+
_inherits(Order, _Declaration);
|
|
12
14
|
|
|
13
15
|
function Order() {
|
|
14
|
-
|
|
16
|
+
_classCallCheck(this, Order);
|
|
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
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Change property name for 2009 and 2012 specs
|
|
23
|
+
*/
|
|
24
|
+
Order.prototype.prefixed = function prefixed(prop, prefix) {
|
|
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 prefix + 'box-ordinal-group';
|
|
34
|
+
} else if (spec === 2012) {
|
|
35
|
+
return prefix + 'flex-order';
|
|
36
|
+
} else {
|
|
37
|
+
return _Declaration.prototype.prefixed.call(this, prop, prefix);
|
|
38
|
+
}
|
|
29
39
|
};
|
|
30
40
|
|
|
31
|
-
|
|
32
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Return property name by final spec
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
Order.prototype.normalize = function normalize() {
|
|
47
|
+
return 'order';
|
|
33
48
|
};
|
|
34
49
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Fix value for 2009 spec
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
Order.prototype.set = function set(decl, prefix) {
|
|
56
|
+
var spec = flexSpec(prefix)[0];
|
|
57
|
+
if (spec === 2009 && /\d/.test(decl.value)) {
|
|
58
|
+
decl.value = (parseInt(decl.value) + 1).toString();
|
|
59
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
60
|
+
} else {
|
|
61
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
62
|
+
}
|
|
44
63
|
};
|
|
45
64
|
|
|
46
65
|
return Order;
|
|
66
|
+
}(Declaration);
|
|
47
67
|
|
|
48
|
-
|
|
68
|
+
Object.defineProperty(Order, 'names', {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
writable: true,
|
|
71
|
+
value: ['order', 'flex-order', 'box-ordinal-group']
|
|
72
|
+
});
|
|
49
73
|
|
|
50
|
-
module.exports = Order;
|
|
51
74
|
|
|
52
|
-
|
|
75
|
+
module.exports = Order;
|