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
package/lib/hacks/align-self.js
CHANGED
|
@@ -1,55 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
var AlignSelf, Declaration, 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 AlignSelf = function (_Declaration) {
|
|
13
|
+
_inherits(AlignSelf, _Declaration);
|
|
12
14
|
|
|
13
15
|
function AlignSelf() {
|
|
14
|
-
|
|
16
|
+
_classCallCheck(this, AlignSelf);
|
|
17
|
+
|
|
18
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
15
19
|
}
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Change property name for 2012 specs
|
|
23
|
+
*/
|
|
24
|
+
AlignSelf.prototype.prefixed = function prefixed(prop, prefix) {
|
|
25
|
+
var spec = void 0;
|
|
18
26
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
var _flexSpec = flexSpec(prefix);
|
|
28
|
+
|
|
29
|
+
spec = _flexSpec[0];
|
|
30
|
+
prefix = _flexSpec[1];
|
|
23
31
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} else {
|
|
30
|
-
return AlignSelf.__super__.prefixed.apply(this, arguments);
|
|
31
|
-
}
|
|
32
|
+
if (spec === 2012) {
|
|
33
|
+
return prefix + 'flex-item-align';
|
|
34
|
+
} else {
|
|
35
|
+
return _Declaration.prototype.prefixed.call(this, prop, prefix);
|
|
36
|
+
}
|
|
32
37
|
};
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Return property name by final spec
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
AlignSelf.prototype.normalize = function normalize() {
|
|
45
|
+
return 'align-self';
|
|
36
46
|
};
|
|
37
47
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Change value for 2012 spec and ignore prefix for 2009
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
AlignSelf.prototype.set = function set(decl, prefix) {
|
|
54
|
+
var spec = flexSpec(prefix)[0];
|
|
55
|
+
if (spec === 2012) {
|
|
56
|
+
decl.value = AlignSelf.oldValues[decl.value] || decl.value;
|
|
57
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
58
|
+
} else if (spec === 'final') {
|
|
59
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
60
|
+
}
|
|
61
|
+
return undefined;
|
|
47
62
|
};
|
|
48
63
|
|
|
49
64
|
return AlignSelf;
|
|
65
|
+
}(Declaration);
|
|
50
66
|
|
|
51
|
-
|
|
67
|
+
Object.defineProperty(AlignSelf, 'names', {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
writable: true,
|
|
70
|
+
value: ['align-self', 'flex-item-align']
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(AlignSelf, 'oldValues', {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
writable: true,
|
|
75
|
+
value: {
|
|
76
|
+
'flex-end': 'end',
|
|
77
|
+
'flex-start': 'start'
|
|
78
|
+
}
|
|
79
|
+
});
|
|
52
80
|
|
|
53
|
-
module.exports = AlignSelf;
|
|
54
81
|
|
|
55
|
-
|
|
82
|
+
module.exports = AlignSelf;
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
var utils = require('../utils');
|
|
11
|
+
|
|
12
|
+
var Appearance = function (_Declaration) {
|
|
13
|
+
_inherits(Appearance, _Declaration);
|
|
14
|
+
|
|
15
|
+
function Appearance(name, prefixes, all) {
|
|
16
|
+
_classCallCheck(this, Appearance);
|
|
17
|
+
|
|
18
|
+
var _this = _possibleConstructorReturn(this, _Declaration.call(this, name, prefixes, all));
|
|
19
|
+
|
|
20
|
+
if (_this.prefixes) {
|
|
21
|
+
_this.prefixes = utils.uniq(_this.prefixes.map(function (i) {
|
|
22
|
+
if (i === '-ms-') {
|
|
23
|
+
return '-webkit-';
|
|
24
|
+
} else {
|
|
25
|
+
return i;
|
|
26
|
+
}
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
return _this;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return Appearance;
|
|
33
|
+
}(Declaration);
|
|
34
|
+
|
|
35
|
+
Object.defineProperty(Appearance, 'names', {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
writable: true,
|
|
38
|
+
value: ['appearance']
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
module.exports = Appearance;
|
|
@@ -1,32 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
var BackgroundSize, Declaration,
|
|
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 BackgroundSize = function (_Declaration) {
|
|
12
|
+
_inherits(BackgroundSize, _Declaration);
|
|
10
13
|
|
|
11
14
|
function BackgroundSize() {
|
|
12
|
-
|
|
13
|
-
}
|
|
15
|
+
_classCallCheck(this, BackgroundSize);
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
18
|
+
}
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Duplication parameter for -webkit- browsers
|
|
22
|
+
*/
|
|
23
|
+
BackgroundSize.prototype.set = function set(decl, prefix) {
|
|
24
|
+
var value = decl.value.toLowerCase();
|
|
25
|
+
if (prefix === '-webkit-' && value.indexOf(' ') === -1 && value !== 'contain' && value !== 'cover') {
|
|
26
|
+
decl.value = decl.value + ' ' + decl.value;
|
|
27
|
+
}
|
|
28
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
24
29
|
};
|
|
25
30
|
|
|
26
31
|
return BackgroundSize;
|
|
32
|
+
}(Declaration);
|
|
27
33
|
|
|
28
|
-
|
|
34
|
+
Object.defineProperty(BackgroundSize, 'names', {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
writable: true,
|
|
37
|
+
value: ['background-size']
|
|
38
|
+
});
|
|
29
39
|
|
|
30
|
-
module.exports = BackgroundSize;
|
|
31
40
|
|
|
32
|
-
|
|
41
|
+
module.exports = BackgroundSize;
|
|
@@ -1,35 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
var BlockLogical, Declaration,
|
|
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 BlockLogical = function (_Declaration) {
|
|
12
|
+
_inherits(BlockLogical, _Declaration);
|
|
10
13
|
|
|
11
14
|
function BlockLogical() {
|
|
12
|
-
|
|
13
|
-
}
|
|
15
|
+
_classCallCheck(this, BlockLogical);
|
|
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
|
+
BlockLogical.prototype.prefixed = function prefixed(prop, prefix) {
|
|
24
|
+
return prefix + (prop.indexOf('-start') !== -1 ? prop.replace('-block-start', '-before') : prop.replace('-block-end', '-after'));
|
|
19
25
|
};
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Return property name by spec
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
BlockLogical.prototype.normalize = function normalize(prop) {
|
|
33
|
+
if (prop.indexOf('-before') !== -1) {
|
|
34
|
+
return prop.replace('-before', '-block-start');
|
|
35
|
+
} else {
|
|
36
|
+
return prop.replace('-after', '-block-end');
|
|
37
|
+
}
|
|
27
38
|
};
|
|
28
39
|
|
|
29
40
|
return BlockLogical;
|
|
41
|
+
}(Declaration);
|
|
30
42
|
|
|
31
|
-
|
|
43
|
+
Object.defineProperty(BlockLogical, 'names', {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
writable: true,
|
|
46
|
+
value: ['border-block-start', 'border-block-end', 'margin-block-start', 'margin-block-end', 'padding-block-start', 'padding-block-end', 'border-before', 'border-after', 'margin-before', 'margin-after', 'padding-before', 'padding-after']
|
|
47
|
+
});
|
|
32
48
|
|
|
33
|
-
module.exports = BlockLogical;
|
|
34
49
|
|
|
35
|
-
|
|
50
|
+
module.exports = BlockLogical;
|
|
@@ -1,28 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
var BorderImage, Declaration,
|
|
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 BorderImage = function (_Declaration) {
|
|
12
|
+
_inherits(BorderImage, _Declaration);
|
|
10
13
|
|
|
11
14
|
function BorderImage() {
|
|
12
|
-
|
|
13
|
-
}
|
|
15
|
+
_classCallCheck(this, BorderImage);
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
18
|
+
}
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Remove fill parameter for prefixed declarations
|
|
22
|
+
*/
|
|
23
|
+
BorderImage.prototype.set = function set(decl, prefix) {
|
|
24
|
+
decl.value = decl.value.replace(/\s+fill(\s)/, '$1');
|
|
25
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
20
26
|
};
|
|
21
27
|
|
|
22
28
|
return BorderImage;
|
|
29
|
+
}(Declaration);
|
|
23
30
|
|
|
24
|
-
|
|
31
|
+
Object.defineProperty(BorderImage, 'names', {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
writable: true,
|
|
34
|
+
value: ['border-image']
|
|
35
|
+
});
|
|
25
36
|
|
|
26
|
-
module.exports = BorderImage;
|
|
27
37
|
|
|
28
|
-
|
|
38
|
+
module.exports = BorderImage;
|
|
@@ -1,56 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
var BorderRadius, Declaration,
|
|
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
|
-
var hor, i, j, len, len1, mozilla, normal, ref, ref1, ver;
|
|
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; }
|
|
10
6
|
|
|
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; }
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
return BorderRadius.__super__.constructor.apply(this, arguments);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
BorderRadius.names = ['border-radius'];
|
|
9
|
+
var Declaration = require('../declaration');
|
|
18
10
|
|
|
19
|
-
|
|
11
|
+
var BorderRadius = function (_Declaration) {
|
|
12
|
+
_inherits(BorderRadius, _Declaration);
|
|
20
13
|
|
|
21
|
-
BorderRadius
|
|
14
|
+
function BorderRadius() {
|
|
15
|
+
_classCallCheck(this, BorderRadius);
|
|
22
16
|
|
|
23
|
-
|
|
24
|
-
for (i = 0, len = ref.length; i < len; i++) {
|
|
25
|
-
ver = ref[i];
|
|
26
|
-
ref1 = ['left', 'right'];
|
|
27
|
-
for (j = 0, len1 = ref1.length; j < len1; j++) {
|
|
28
|
-
hor = ref1[j];
|
|
29
|
-
normal = "border-" + ver + "-" + hor + "-radius";
|
|
30
|
-
mozilla = "border-radius-" + ver + hor;
|
|
31
|
-
BorderRadius.names.push(normal);
|
|
32
|
-
BorderRadius.names.push(mozilla);
|
|
33
|
-
BorderRadius.toMozilla[normal] = mozilla;
|
|
34
|
-
BorderRadius.toNormal[mozilla] = normal;
|
|
35
|
-
}
|
|
17
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
36
18
|
}
|
|
37
19
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Change syntax, when add Mozilla prefix
|
|
22
|
+
*/
|
|
23
|
+
BorderRadius.prototype.prefixed = function prefixed(prop, prefix) {
|
|
24
|
+
if (prefix === '-moz-') {
|
|
25
|
+
return prefix + (BorderRadius.toMozilla[prop] || prop);
|
|
26
|
+
} else {
|
|
27
|
+
return _Declaration.prototype.prefixed.call(this, prop, prefix);
|
|
28
|
+
}
|
|
44
29
|
};
|
|
45
30
|
|
|
46
|
-
|
|
47
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Return unprefixed version of property
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
BorderRadius.prototype.normalize = function normalize(prop) {
|
|
37
|
+
return BorderRadius.toNormal[prop] || prop;
|
|
48
38
|
};
|
|
49
39
|
|
|
50
40
|
return BorderRadius;
|
|
41
|
+
}(Declaration);
|
|
51
42
|
|
|
52
|
-
|
|
43
|
+
Object.defineProperty(BorderRadius, 'names', {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
writable: true,
|
|
46
|
+
value: ['border-radius']
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(BorderRadius, 'toMozilla', {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
writable: true,
|
|
51
|
+
value: {}
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(BorderRadius, 'toNormal', {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
writable: true,
|
|
56
|
+
value: {}
|
|
57
|
+
});
|
|
58
|
+
var _arr = ['top', 'bottom'];
|
|
53
59
|
|
|
54
|
-
module.exports = BorderRadius;
|
|
55
60
|
|
|
56
|
-
|
|
61
|
+
for (var _i = 0; _i < _arr.length; _i++) {
|
|
62
|
+
var ver = _arr[_i];var _arr2 = ['left', 'right'];
|
|
63
|
+
|
|
64
|
+
for (var _i2 = 0; _i2 < _arr2.length; _i2++) {
|
|
65
|
+
var hor = _arr2[_i2];
|
|
66
|
+
var normal = 'border-' + ver + '-' + hor + '-radius';
|
|
67
|
+
var mozilla = 'border-radius-' + ver + hor;
|
|
68
|
+
|
|
69
|
+
BorderRadius.names.push(normal);
|
|
70
|
+
BorderRadius.names.push(mozilla);
|
|
71
|
+
|
|
72
|
+
BorderRadius.toMozilla[normal] = mozilla;
|
|
73
|
+
BorderRadius.toNormal[mozilla] = normal;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
module.exports = BorderRadius;
|
package/lib/hacks/break-props.js
CHANGED
|
@@ -1,64 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
var BreakProps, Declaration,
|
|
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 BreakProps = function (_Declaration) {
|
|
12
|
+
_inherits(BreakProps, _Declaration);
|
|
10
13
|
|
|
11
14
|
function BreakProps() {
|
|
12
|
-
|
|
13
|
-
}
|
|
15
|
+
_classCallCheck(this, BreakProps);
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
|
|
18
|
+
}
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Change name for -webkit- and -moz- prefix
|
|
22
|
+
*/
|
|
23
|
+
BreakProps.prototype.prefixed = function prefixed(prop, prefix) {
|
|
24
|
+
if (prefix === '-webkit-') {
|
|
25
|
+
return '-webkit-column-' + prop;
|
|
26
|
+
} else if (prefix === '-moz-') {
|
|
27
|
+
return 'page-' + prop;
|
|
28
|
+
} else {
|
|
29
|
+
return _Declaration.prototype.prefixed.call(this, prop, prefix);
|
|
30
|
+
}
|
|
25
31
|
};
|
|
26
32
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Return property name by final spec
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
BreakProps.prototype.normalize = function normalize(prop) {
|
|
39
|
+
if (prop.indexOf('inside') !== -1) {
|
|
40
|
+
return 'break-inside';
|
|
41
|
+
} else if (prop.indexOf('before') !== -1) {
|
|
42
|
+
return 'break-before';
|
|
43
|
+
} else if (prop.indexOf('after') !== -1) {
|
|
44
|
+
return 'break-after';
|
|
45
|
+
}
|
|
46
|
+
return undefined;
|
|
35
47
|
};
|
|
36
48
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Change prefixed value for avoid-column and avoid-page
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
BreakProps.prototype.set = function set(decl, prefix) {
|
|
55
|
+
var v = decl.value;
|
|
56
|
+
if (decl.prop === 'break-inside' && v === 'avoid-column' || v === 'avoid-page') {
|
|
57
|
+
decl.value = 'avoid';
|
|
58
|
+
}
|
|
59
|
+
return _Declaration.prototype.set.call(this, decl, prefix);
|
|
44
60
|
};
|
|
45
61
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
} else if (decl.value === 'avoid-region') {
|
|
62
|
+
/**
|
|
63
|
+
* Don’t prefix some values
|
|
64
|
+
*/
|
|
50
65
|
|
|
51
|
-
} else if (decl.value === 'avoid-page' && prefix === '-webkit-') {
|
|
52
66
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
67
|
+
BreakProps.prototype.insert = function insert(decl, prefix, prefixes) {
|
|
68
|
+
if (decl.prop !== 'break-inside') {
|
|
69
|
+
return _Declaration.prototype.insert.call(this, decl, prefix, prefixes);
|
|
70
|
+
} else if (decl.value === 'avoid-region') {
|
|
71
|
+
return undefined;
|
|
72
|
+
} else if (decl.value === 'avoid-page' && prefix === '-webkit-') {
|
|
73
|
+
return undefined;
|
|
74
|
+
} else {
|
|
75
|
+
return _Declaration.prototype.insert.call(this, decl, prefix, prefixes);
|
|
76
|
+
}
|
|
56
77
|
};
|
|
57
78
|
|
|
58
79
|
return BreakProps;
|
|
80
|
+
}(Declaration);
|
|
59
81
|
|
|
60
|
-
|
|
82
|
+
Object.defineProperty(BreakProps, 'names', {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
writable: true,
|
|
85
|
+
value: ['break-inside', 'page-break-inside', 'column-break-inside', 'break-before', 'page-break-before', 'column-break-before', 'break-after', 'page-break-after', 'column-break-after']
|
|
86
|
+
});
|
|
61
87
|
|
|
62
|
-
module.exports = BreakProps;
|
|
63
88
|
|
|
64
|
-
|
|
89
|
+
module.exports = BreakProps;
|