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.
Files changed (80) hide show
  1. package/CHANGELOG.md +999 -0
  2. package/README.md +0 -3
  3. package/bin/autoprefixer +11 -11
  4. package/data/prefixes.js +799 -545
  5. package/lib/at-rule.js +23 -50
  6. package/lib/autoprefixer.js +108 -97
  7. package/lib/brackets.js +31 -44
  8. package/lib/browsers.js +54 -71
  9. package/lib/declaration.js +122 -178
  10. package/lib/hacks/align-content.js +24 -54
  11. package/lib/hacks/align-items.js +23 -53
  12. package/lib/hacks/align-self.js +32 -60
  13. package/lib/hacks/animation.js +11 -29
  14. package/lib/hacks/appearance.js +19 -35
  15. package/lib/hacks/backdrop-filter.js +16 -31
  16. package/lib/hacks/background-clip.js +19 -36
  17. package/lib/hacks/background-size.js +16 -31
  18. package/lib/hacks/block-logical.js +28 -36
  19. package/lib/hacks/border-image.js +9 -27
  20. package/lib/hacks/border-radius.js +22 -44
  21. package/lib/hacks/break-props.js +38 -51
  22. package/lib/hacks/color-adjust.js +11 -30
  23. package/lib/hacks/cross-fade.js +29 -48
  24. package/lib/hacks/display-flex.js +32 -61
  25. package/lib/hacks/display-grid.js +12 -32
  26. package/lib/hacks/filter-value.js +8 -25
  27. package/lib/hacks/filter.js +13 -27
  28. package/lib/hacks/flex-basis.js +21 -54
  29. package/lib/hacks/flex-direction.js +41 -77
  30. package/lib/hacks/flex-flow.js +33 -61
  31. package/lib/hacks/flex-grow.js +16 -43
  32. package/lib/hacks/flex-shrink.js +21 -54
  33. package/lib/hacks/flex-spec.js +7 -10
  34. package/lib/hacks/flex-wrap.js +11 -32
  35. package/lib/hacks/flex.js +27 -58
  36. package/lib/hacks/fullscreen.js +10 -30
  37. package/lib/hacks/gradient.js +240 -330
  38. package/lib/hacks/grid-area.js +25 -43
  39. package/lib/hacks/grid-column-align.js +14 -34
  40. package/lib/hacks/grid-end.js +30 -45
  41. package/lib/hacks/grid-row-align.js +14 -34
  42. package/lib/hacks/grid-row-column.js +20 -39
  43. package/lib/hacks/grid-rows-columns.js +75 -99
  44. package/lib/hacks/grid-start.js +17 -39
  45. package/lib/hacks/grid-template-areas.js +59 -76
  46. package/lib/hacks/grid-template.js +40 -61
  47. package/lib/hacks/grid-utils.js +686 -716
  48. package/lib/hacks/image-rendering.js +24 -47
  49. package/lib/hacks/image-set.js +10 -30
  50. package/lib/hacks/inline-logical.js +26 -32
  51. package/lib/hacks/intrinsic.js +40 -53
  52. package/lib/hacks/justify-content.js +26 -57
  53. package/lib/hacks/mask-border.js +28 -36
  54. package/lib/hacks/mask-composite.js +41 -57
  55. package/lib/hacks/order.js +22 -52
  56. package/lib/hacks/overscroll-behavior.js +16 -37
  57. package/lib/hacks/pixelated.js +16 -40
  58. package/lib/hacks/place-self.js +18 -41
  59. package/lib/hacks/placeholder-shown.js +9 -28
  60. package/lib/hacks/placeholder.js +15 -38
  61. package/lib/hacks/text-decoration-skip-ink.js +14 -29
  62. package/lib/hacks/text-decoration.js +20 -31
  63. package/lib/hacks/text-emphasis-position.js +9 -28
  64. package/lib/hacks/transform-decl.js +43 -69
  65. package/lib/hacks/user-select.js +19 -27
  66. package/lib/hacks/writing-mode.js +19 -36
  67. package/lib/info.js +63 -93
  68. package/lib/old-selector.js +39 -60
  69. package/lib/old-value.js +17 -25
  70. package/lib/prefixer.js +83 -110
  71. package/lib/prefixes.js +233 -336
  72. package/lib/processor.js +420 -416
  73. package/lib/resolution.js +62 -98
  74. package/lib/selector.js +91 -139
  75. package/lib/supports.js +194 -246
  76. package/lib/transition.js +170 -265
  77. package/lib/utils.js +49 -72
  78. package/lib/value.js +77 -116
  79. package/lib/vendor.js +14 -0
  80. package/package.json +23 -12
@@ -1,71 +1,48 @@
1
- "use strict";
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 ImageRendering = /*#__PURE__*/function (_Declaration) {
12
- _inheritsLoose(ImageRendering, _Declaration);
13
-
14
- function ImageRendering() {
15
- return _Declaration.apply(this, arguments) || this;
16
- }
17
-
18
- var _proto = ImageRendering.prototype;
1
+ let Declaration = require('../declaration')
19
2
 
3
+ class ImageRendering extends Declaration {
20
4
  /**
21
5
  * Add hack only for crisp-edges
22
6
  */
23
- _proto.check = function check(decl) {
24
- return decl.value === 'pixelated';
7
+ check (decl) {
8
+ return decl.value === 'pixelated'
25
9
  }
10
+
26
11
  /**
27
12
  * Change property name for IE
28
13
  */
29
- ;
30
-
31
- _proto.prefixed = function prefixed(prop, prefix) {
14
+ prefixed (prop, prefix) {
32
15
  if (prefix === '-ms-') {
33
- return '-ms-interpolation-mode';
16
+ return '-ms-interpolation-mode'
34
17
  }
35
-
36
- return _Declaration.prototype.prefixed.call(this, prop, prefix);
18
+ return super.prefixed(prop, prefix)
37
19
  }
20
+
38
21
  /**
39
22
  * Change property and value for IE
40
23
  */
41
- ;
42
-
43
- _proto.set = function set(decl, prefix) {
44
- if (prefix !== '-ms-') return _Declaration.prototype.set.call(this, decl, prefix);
45
- decl.prop = '-ms-interpolation-mode';
46
- decl.value = 'nearest-neighbor';
47
- return decl;
24
+ set (decl, prefix) {
25
+ if (prefix !== '-ms-') return super.set(decl, prefix)
26
+ decl.prop = '-ms-interpolation-mode'
27
+ decl.value = 'nearest-neighbor'
28
+ return decl
48
29
  }
30
+
49
31
  /**
50
32
  * Return property name by spec
51
33
  */
52
- ;
53
-
54
- _proto.normalize = function normalize() {
55
- return 'image-rendering';
34
+ normalize () {
35
+ return 'image-rendering'
56
36
  }
37
+
57
38
  /**
58
39
  * Warn on old value
59
40
  */
60
- ;
61
-
62
- _proto.process = function process(node, result) {
63
- return _Declaration.prototype.process.call(this, node, result);
64
- };
65
-
66
- return ImageRendering;
67
- }(Declaration);
41
+ process (node, result) {
42
+ return super.process(node, result)
43
+ }
44
+ }
68
45
 
69
- _defineProperty(ImageRendering, "names", ['image-rendering', 'interpolation-mode']);
46
+ ImageRendering.names = ['image-rendering', 'interpolation-mode']
70
47
 
71
- module.exports = ImageRendering;
48
+ module.exports = ImageRendering
@@ -1,38 +1,18 @@
1
- "use strict";
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 ImageSet = /*#__PURE__*/function (_Value) {
12
- _inheritsLoose(ImageSet, _Value);
13
-
14
- function ImageSet() {
15
- return _Value.apply(this, arguments) || this;
16
- }
17
-
18
- var _proto = ImageSet.prototype;
1
+ let Value = require('../value')
19
2
 
3
+ class ImageSet extends Value {
20
4
  /**
21
5
  * Use non-standard name for WebKit and Firefox
22
6
  */
23
- _proto.replace = function replace(string, prefix) {
24
- var fixed = _Value.prototype.replace.call(this, string, prefix);
25
-
7
+ replace (string, prefix) {
8
+ let fixed = super.replace(string, prefix)
26
9
  if (prefix === '-webkit-') {
27
- fixed = fixed.replace(/("[^"]+"|'[^']+')(\s+\d+\w)/gi, 'url($1)$2');
10
+ fixed = fixed.replace(/("[^"]+"|'[^']+')(\s+\d+\w)/gi, 'url($1)$2')
28
11
  }
12
+ return fixed
13
+ }
14
+ }
29
15
 
30
- return fixed;
31
- };
32
-
33
- return ImageSet;
34
- }(Value);
35
-
36
- _defineProperty(ImageSet, "names", ['image-set']);
16
+ ImageSet.names = ['image-set']
37
17
 
38
- module.exports = ImageSet;
18
+ module.exports = ImageSet
@@ -1,40 +1,34 @@
1
- "use strict";
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 InlineLogical = /*#__PURE__*/function (_Declaration) {
12
- _inheritsLoose(InlineLogical, _Declaration);
13
-
14
- function InlineLogical() {
15
- return _Declaration.apply(this, arguments) || this;
16
- }
17
-
18
- var _proto = InlineLogical.prototype;
1
+ let Declaration = require('../declaration')
19
2
 
3
+ class InlineLogical extends Declaration {
20
4
  /**
21
5
  * Use old syntax for -moz- and -webkit-
22
6
  */
23
- _proto.prefixed = function prefixed(prop, prefix) {
24
- return prefix + prop.replace('-inline', '');
7
+ prefixed (prop, prefix) {
8
+ return prefix + prop.replace('-inline', '')
25
9
  }
10
+
26
11
  /**
27
12
  * Return property name by spec
28
13
  */
29
- ;
30
-
31
- _proto.normalize = function normalize(prop) {
32
- return prop.replace(/(margin|padding|border)-(start|end)/, '$1-inline-$2');
33
- };
34
-
35
- return InlineLogical;
36
- }(Declaration);
37
-
38
- _defineProperty(InlineLogical, "names", ['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']);
39
-
40
- module.exports = InlineLogical;
14
+ normalize (prop) {
15
+ return prop.replace(/(margin|padding|border)-(start|end)/, '$1-inline-$2')
16
+ }
17
+ }
18
+
19
+ InlineLogical.names = [
20
+ 'border-inline-start',
21
+ 'border-inline-end',
22
+ 'margin-inline-start',
23
+ 'margin-inline-end',
24
+ 'padding-inline-start',
25
+ 'padding-inline-end',
26
+ 'border-start',
27
+ 'border-end',
28
+ 'margin-start',
29
+ 'margin-end',
30
+ 'padding-start',
31
+ 'padding-end'
32
+ ]
33
+
34
+ module.exports = InlineLogical
@@ -1,74 +1,61 @@
1
- "use strict";
1
+ let OldValue = require('../old-value')
2
+ let Value = require('../value')
2
3
 
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 OldValue = require('../old-value');
10
-
11
- var Value = require('../value');
12
-
13
- function _regexp(name) {
14
- return new RegExp("(^|[\\s,(])(" + name + "($|[\\s),]))", 'gi');
4
+ function regexp (name) {
5
+ return new RegExp(`(^|[\\s,(])(${name}($|[\\s),]))`, 'gi')
15
6
  }
16
7
 
17
- var Intrinsic = /*#__PURE__*/function (_Value) {
18
- _inheritsLoose(Intrinsic, _Value);
19
-
20
- function Intrinsic() {
21
- return _Value.apply(this, arguments) || this;
8
+ class Intrinsic extends Value {
9
+ regexp () {
10
+ if (!this.regexpCache) this.regexpCache = regexp(this.name)
11
+ return this.regexpCache
22
12
  }
23
13
 
24
- var _proto = Intrinsic.prototype;
25
-
26
- _proto.regexp = function regexp() {
27
- if (!this.regexpCache) this.regexpCache = _regexp(this.name);
28
- return this.regexpCache;
29
- };
30
-
31
- _proto.isStretch = function isStretch() {
32
- return this.name === 'stretch' || this.name === 'fill' || this.name === 'fill-available';
33
- };
14
+ isStretch () {
15
+ return (
16
+ this.name === 'stretch' ||
17
+ this.name === 'fill' ||
18
+ this.name === 'fill-available'
19
+ )
20
+ }
34
21
 
35
- _proto.replace = function replace(string, prefix) {
22
+ replace (string, prefix) {
36
23
  if (prefix === '-moz-' && this.isStretch()) {
37
- return string.replace(this.regexp(), '$1-moz-available$3');
24
+ return string.replace(this.regexp(), '$1-moz-available$3')
38
25
  }
39
-
40
26
  if (prefix === '-webkit-' && this.isStretch()) {
41
- return string.replace(this.regexp(), '$1-webkit-fill-available$3');
27
+ return string.replace(this.regexp(), '$1-webkit-fill-available$3')
42
28
  }
29
+ return super.replace(string, prefix)
30
+ }
43
31
 
44
- return _Value.prototype.replace.call(this, string, prefix);
45
- };
46
-
47
- _proto.old = function old(prefix) {
48
- var prefixed = prefix + this.name;
49
-
32
+ old (prefix) {
33
+ let prefixed = prefix + this.name
50
34
  if (this.isStretch()) {
51
35
  if (prefix === '-moz-') {
52
- prefixed = '-moz-available';
36
+ prefixed = '-moz-available'
53
37
  } else if (prefix === '-webkit-') {
54
- prefixed = '-webkit-fill-available';
38
+ prefixed = '-webkit-fill-available'
55
39
  }
56
40
  }
41
+ return new OldValue(this.name, prefixed, prefixed, regexp(prefixed))
42
+ }
57
43
 
58
- return new OldValue(this.name, prefixed, prefixed, _regexp(prefixed));
59
- };
60
-
61
- _proto.add = function add(decl, prefix) {
44
+ add (decl, prefix) {
62
45
  if (decl.prop.includes('grid') && prefix !== '-webkit-') {
63
- return undefined;
46
+ return undefined
64
47
  }
48
+ return super.add(decl, prefix)
49
+ }
50
+ }
65
51
 
66
- return _Value.prototype.add.call(this, decl, prefix);
67
- };
68
-
69
- return Intrinsic;
70
- }(Value);
71
-
72
- _defineProperty(Intrinsic, "names", ['max-content', 'min-content', 'fit-content', 'fill', 'fill-available', 'stretch']);
52
+ Intrinsic.names = [
53
+ 'max-content',
54
+ 'min-content',
55
+ 'fit-content',
56
+ 'fill',
57
+ 'fill-available',
58
+ 'stretch'
59
+ ]
73
60
 
74
- module.exports = Intrinsic;
61
+ module.exports = Intrinsic
@@ -1,85 +1,54 @@
1
- "use strict";
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 JustifyContent = /*#__PURE__*/function (_Declaration) {
14
- _inheritsLoose(JustifyContent, _Declaration);
15
-
16
- function JustifyContent() {
17
- return _Declaration.apply(this, arguments) || this;
18
- }
19
-
20
- var _proto = JustifyContent.prototype;
1
+ let flexSpec = require('./flex-spec')
2
+ let Declaration = require('../declaration')
21
3
 
4
+ class JustifyContent extends Declaration {
22
5
  /**
23
6
  * Change property name for 2009 and 2012 specs
24
7
  */
25
- _proto.prefixed = function prefixed(prop, prefix) {
26
- var spec;
27
-
28
- var _flexSpec = flexSpec(prefix);
29
-
30
- spec = _flexSpec[0];
31
- prefix = _flexSpec[1];
32
-
8
+ prefixed (prop, prefix) {
9
+ let spec
10
+ ;[spec, prefix] = flexSpec(prefix)
33
11
  if (spec === 2009) {
34
- return prefix + 'box-pack';
12
+ return prefix + 'box-pack'
35
13
  }
36
-
37
14
  if (spec === 2012) {
38
- return prefix + 'flex-pack';
15
+ return prefix + 'flex-pack'
39
16
  }
40
-
41
- return _Declaration.prototype.prefixed.call(this, prop, prefix);
17
+ return super.prefixed(prop, prefix)
42
18
  }
19
+
43
20
  /**
44
21
  * Return property name by final spec
45
22
  */
46
- ;
47
-
48
- _proto.normalize = function normalize() {
49
- return 'justify-content';
23
+ normalize () {
24
+ return 'justify-content'
50
25
  }
26
+
51
27
  /**
52
28
  * Change value for 2009 and 2012 specs
53
29
  */
54
- ;
55
-
56
- _proto.set = function set(decl, prefix) {
57
- var spec = flexSpec(prefix)[0];
58
-
30
+ set (decl, prefix) {
31
+ let spec = flexSpec(prefix)[0]
59
32
  if (spec === 2009 || spec === 2012) {
60
- var value = JustifyContent.oldValues[decl.value] || decl.value;
61
- decl.value = value;
62
-
33
+ let value = JustifyContent.oldValues[decl.value] || decl.value
34
+ decl.value = value
63
35
  if (spec !== 2009 || value !== 'distribute') {
64
- return _Declaration.prototype.set.call(this, decl, prefix);
36
+ return super.set(decl, prefix)
65
37
  }
66
38
  } else if (spec === 'final') {
67
- return _Declaration.prototype.set.call(this, decl, prefix);
39
+ return super.set(decl, prefix)
68
40
  }
41
+ return undefined
42
+ }
43
+ }
69
44
 
70
- return undefined;
71
- };
72
-
73
- return JustifyContent;
74
- }(Declaration);
75
-
76
- _defineProperty(JustifyContent, "names", ['justify-content', 'flex-pack', 'box-pack']);
45
+ JustifyContent.names = ['justify-content', 'flex-pack', 'box-pack']
77
46
 
78
- _defineProperty(JustifyContent, "oldValues", {
47
+ JustifyContent.oldValues = {
79
48
  'flex-end': 'end',
80
49
  'flex-start': 'start',
81
50
  'space-between': 'justify',
82
51
  'space-around': 'distribute'
83
- });
52
+ }
84
53
 
85
- module.exports = JustifyContent;
54
+ module.exports = JustifyContent
@@ -1,46 +1,38 @@
1
- "use strict";
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 MaskBorder = /*#__PURE__*/function (_Declaration) {
12
- _inheritsLoose(MaskBorder, _Declaration);
13
-
14
- function MaskBorder() {
15
- return _Declaration.apply(this, arguments) || this;
16
- }
17
-
18
- var _proto = MaskBorder.prototype;
1
+ let Declaration = require('../declaration')
19
2
 
3
+ class MaskBorder extends Declaration {
20
4
  /**
21
5
  * Return property name by final spec
22
6
  */
23
- _proto.normalize = function normalize() {
24
- return this.name.replace('box-image', 'border');
7
+ normalize () {
8
+ return this.name.replace('box-image', 'border')
25
9
  }
10
+
26
11
  /**
27
12
  * Return flex property for 2012 spec
28
13
  */
29
- ;
30
-
31
- _proto.prefixed = function prefixed(prop, prefix) {
32
- var result = _Declaration.prototype.prefixed.call(this, prop, prefix);
33
-
14
+ prefixed (prop, prefix) {
15
+ let result = super.prefixed(prop, prefix)
34
16
  if (prefix === '-webkit-') {
35
- result = result.replace('border', 'box-image');
17
+ result = result.replace('border', 'box-image')
36
18
  }
37
-
38
- return result;
39
- };
40
-
41
- return MaskBorder;
42
- }(Declaration);
43
-
44
- _defineProperty(MaskBorder, "names", ['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']);
45
-
46
- module.exports = MaskBorder;
19
+ return result
20
+ }
21
+ }
22
+
23
+ MaskBorder.names = [
24
+ 'mask-border',
25
+ 'mask-border-source',
26
+ 'mask-border-slice',
27
+ 'mask-border-width',
28
+ 'mask-border-outset',
29
+ 'mask-border-repeat',
30
+ 'mask-box-image',
31
+ 'mask-box-image-source',
32
+ 'mask-box-image-slice',
33
+ 'mask-box-image-width',
34
+ 'mask-box-image-outset',
35
+ 'mask-box-image-repeat'
36
+ ]
37
+
38
+ module.exports = MaskBorder
@@ -1,104 +1,88 @@
1
- "use strict";
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 MaskComposite = /*#__PURE__*/function (_Declaration) {
12
- _inheritsLoose(MaskComposite, _Declaration);
13
-
14
- function MaskComposite() {
15
- return _Declaration.apply(this, arguments) || this;
16
- }
17
-
18
- var _proto = MaskComposite.prototype;
1
+ let Declaration = require('../declaration')
19
2
 
3
+ class MaskComposite extends Declaration {
20
4
  /**
21
5
  * Prefix mask-composite for webkit
22
6
  */
23
- _proto.insert = function insert(decl, prefix, prefixes) {
24
- var isCompositeProp = decl.prop === 'mask-composite';
25
- var compositeValues;
7
+ insert (decl, prefix, prefixes) {
8
+ let isCompositeProp = decl.prop === 'mask-composite'
9
+
10
+ let compositeValues
26
11
 
27
12
  if (isCompositeProp) {
28
- compositeValues = decl.value.split(',');
13
+ compositeValues = decl.value.split(',')
29
14
  } else {
30
- compositeValues = decl.value.match(MaskComposite.regexp) || [];
15
+ compositeValues = decl.value.match(MaskComposite.regexp) || []
31
16
  }
32
17
 
33
- compositeValues = compositeValues.map(function (el) {
34
- return el.trim();
35
- }).filter(function (el) {
36
- return el;
37
- });
38
- var hasCompositeValues = compositeValues.length;
39
- var compositeDecl;
18
+ compositeValues = compositeValues.map(el => el.trim()).filter(el => el)
19
+ let hasCompositeValues = compositeValues.length
20
+
21
+ let compositeDecl
40
22
 
41
23
  if (hasCompositeValues) {
42
- compositeDecl = this.clone(decl);
43
- compositeDecl.value = compositeValues.map(function (value) {
44
- return MaskComposite.oldValues[value] || value;
45
- }).join(', ');
24
+ compositeDecl = this.clone(decl)
25
+ compositeDecl.value = compositeValues
26
+ .map(value => MaskComposite.oldValues[value] || value)
27
+ .join(', ')
46
28
 
47
29
  if (compositeValues.includes('intersect')) {
48
- compositeDecl.value += ', xor';
30
+ compositeDecl.value += ', xor'
49
31
  }
50
32
 
51
- compositeDecl.prop = prefix + 'mask-composite';
33
+ compositeDecl.prop = prefix + 'mask-composite'
52
34
  }
53
35
 
54
36
  if (isCompositeProp) {
55
37
  if (!hasCompositeValues) {
56
- return undefined;
38
+ return undefined
57
39
  }
58
40
 
59
41
  if (this.needCascade(decl)) {
60
- compositeDecl.raws.before = this.calcBefore(prefixes, decl, prefix);
42
+ compositeDecl.raws.before = this.calcBefore(prefixes, decl, prefix)
61
43
  }
62
44
 
63
- return decl.parent.insertBefore(decl, compositeDecl);
45
+ return decl.parent.insertBefore(decl, compositeDecl)
64
46
  }
65
47
 
66
- var cloned = this.clone(decl);
67
- cloned.prop = prefix + cloned.prop;
48
+ let cloned = this.clone(decl)
49
+ cloned.prop = prefix + cloned.prop
68
50
 
69
51
  if (hasCompositeValues) {
70
- cloned.value = cloned.value.replace(MaskComposite.regexp, '');
52
+ cloned.value = cloned.value.replace(MaskComposite.regexp, '')
71
53
  }
72
54
 
73
55
  if (this.needCascade(decl)) {
74
- cloned.raws.before = this.calcBefore(prefixes, decl, prefix);
56
+ cloned.raws.before = this.calcBefore(prefixes, decl, prefix)
75
57
  }
76
58
 
77
- decl.parent.insertBefore(decl, cloned);
59
+ decl.parent.insertBefore(decl, cloned)
78
60
 
79
61
  if (!hasCompositeValues) {
80
- return decl;
62
+ return decl
81
63
  }
82
64
 
83
65
  if (this.needCascade(decl)) {
84
- compositeDecl.raws.before = this.calcBefore(prefixes, decl, prefix);
66
+ compositeDecl.raws.before = this.calcBefore(prefixes, decl, prefix)
85
67
  }
68
+ return decl.parent.insertBefore(decl, compositeDecl)
69
+ }
70
+ }
86
71
 
87
- return decl.parent.insertBefore(decl, compositeDecl);
88
- };
89
-
90
- return MaskComposite;
91
- }(Declaration);
92
-
93
- _defineProperty(MaskComposite, "names", ['mask', 'mask-composite']);
72
+ MaskComposite.names = ['mask', 'mask-composite']
94
73
 
95
- _defineProperty(MaskComposite, "oldValues", {
74
+ MaskComposite.oldValues = {
96
75
  add: 'source-over',
97
76
  substract: 'source-out',
98
77
  intersect: 'source-in',
99
78
  exclude: 'xor'
100
- });
79
+ }
101
80
 
102
- _defineProperty(MaskComposite, "regexp", new RegExp("\\s+(" + Object.keys(MaskComposite.oldValues).join('|') + ")\\b(?!\\))\\s*(?=[,])", 'ig'));
81
+ MaskComposite.regexp = new RegExp(
82
+ `\\s+(${Object.keys(MaskComposite.oldValues).join(
83
+ '|'
84
+ )})\\b(?!\\))\\s*(?=[,])`,
85
+ 'ig'
86
+ )
103
87
 
104
- module.exports = MaskComposite;
88
+ module.exports = MaskComposite