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,243 +1,187 @@
1
- "use strict";
1
+ let Prefixer = require('./prefixer')
2
+ let Browsers = require('./browsers')
3
+ let utils = require('./utils')
2
4
 
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 _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
6
-
7
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
-
9
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
10
-
11
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
12
-
13
- var Prefixer = require('./prefixer');
14
-
15
- var Browsers = require('./browsers');
16
-
17
- var utils = require('./utils');
18
-
19
- var Declaration = /*#__PURE__*/function (_Prefixer) {
20
- _inheritsLoose(Declaration, _Prefixer);
21
-
22
- function Declaration() {
23
- return _Prefixer.apply(this, arguments) || this;
5
+ class Declaration extends Prefixer {
6
+ /**
7
+ * Always true, because we already get prefixer by property name
8
+ */
9
+ check (/* decl */) {
10
+ return true
24
11
  }
25
12
 
26
- var _proto = Declaration.prototype;
27
-
28
13
  /**
29
- * Always true, because we already get prefixer by property name
30
- */
31
- _proto.check = function check()
32
- /* decl */
33
- {
34
- return true;
14
+ * Return prefixed version of property
15
+ */
16
+ prefixed (prop, prefix) {
17
+ return prefix + prop
35
18
  }
36
- /**
37
- * Return prefixed version of property
38
- */
39
- ;
40
19
 
41
- _proto.prefixed = function prefixed(prop, prefix) {
42
- return prefix + prop;
43
- }
44
20
  /**
45
- * Return unprefixed version of property
46
- */
47
- ;
48
-
49
- _proto.normalize = function normalize(prop) {
50
- return prop;
21
+ * Return unprefixed version of property
22
+ */
23
+ normalize (prop) {
24
+ return prop
51
25
  }
52
- /**
53
- * Check `value`, that it contain other prefixes, rather than `prefix`
54
- */
55
- ;
56
-
57
- _proto.otherPrefixes = function otherPrefixes(value, prefix) {
58
- for (var _iterator = _createForOfIteratorHelperLoose(Browsers.prefixes()), _step; !(_step = _iterator()).done;) {
59
- var other = _step.value;
60
26
 
27
+ /**
28
+ * Check `value`, that it contain other prefixes, rather than `prefix`
29
+ */
30
+ otherPrefixes (value, prefix) {
31
+ for (let other of Browsers.prefixes()) {
61
32
  if (other === prefix) {
62
- continue;
33
+ continue
63
34
  }
64
-
65
35
  if (value.includes(other)) {
66
- return true;
36
+ return true
67
37
  }
68
38
  }
69
-
70
- return false;
39
+ return false
71
40
  }
72
- /**
73
- * Set prefix to declaration
74
- */
75
- ;
76
41
 
77
- _proto.set = function set(decl, prefix) {
78
- decl.prop = this.prefixed(decl.prop, prefix);
79
- return decl;
80
- }
81
42
  /**
82
- * Should we use visual cascade for prefixes
83
- */
84
- ;
43
+ * Set prefix to declaration
44
+ */
45
+ set (decl, prefix) {
46
+ decl.prop = this.prefixed(decl.prop, prefix)
47
+ return decl
48
+ }
85
49
 
86
- _proto.needCascade = function needCascade(decl) {
50
+ /**
51
+ * Should we use visual cascade for prefixes
52
+ */
53
+ needCascade (decl) {
87
54
  if (!decl._autoprefixerCascade) {
88
- decl._autoprefixerCascade = this.all.options.cascade !== false && decl.raw('before').includes('\n');
55
+ decl._autoprefixerCascade =
56
+ this.all.options.cascade !== false && decl.raw('before').includes('\n')
89
57
  }
90
-
91
- return decl._autoprefixerCascade;
58
+ return decl._autoprefixerCascade
92
59
  }
93
- /**
94
- * Return maximum length of possible prefixed property
95
- */
96
- ;
97
60
 
98
- _proto.maxPrefixed = function maxPrefixed(prefixes, decl) {
61
+ /**
62
+ * Return maximum length of possible prefixed property
63
+ */
64
+ maxPrefixed (prefixes, decl) {
99
65
  if (decl._autoprefixerMax) {
100
- return decl._autoprefixerMax;
66
+ return decl._autoprefixerMax
101
67
  }
102
68
 
103
- var max = 0;
104
-
105
- for (var _iterator2 = _createForOfIteratorHelperLoose(prefixes), _step2; !(_step2 = _iterator2()).done;) {
106
- var prefix = _step2.value;
107
- prefix = utils.removeNote(prefix);
108
-
69
+ let max = 0
70
+ for (let prefix of prefixes) {
71
+ prefix = utils.removeNote(prefix)
109
72
  if (prefix.length > max) {
110
- max = prefix.length;
73
+ max = prefix.length
111
74
  }
112
75
  }
76
+ decl._autoprefixerMax = max
113
77
 
114
- decl._autoprefixerMax = max;
115
- return decl._autoprefixerMax;
78
+ return decl._autoprefixerMax
116
79
  }
117
- /**
118
- * Calculate indentation to create visual cascade
119
- */
120
- ;
121
-
122
- _proto.calcBefore = function calcBefore(prefixes, decl, prefix) {
123
- if (prefix === void 0) {
124
- prefix = '';
125
- }
126
80
 
127
- var max = this.maxPrefixed(prefixes, decl);
128
- var diff = max - utils.removeNote(prefix).length;
129
- var before = decl.raw('before');
81
+ /**
82
+ * Calculate indentation to create visual cascade
83
+ */
84
+ calcBefore (prefixes, decl, prefix = '') {
85
+ let max = this.maxPrefixed(prefixes, decl)
86
+ let diff = max - utils.removeNote(prefix).length
130
87
 
88
+ let before = decl.raw('before')
131
89
  if (diff > 0) {
132
- before += Array(diff).fill(' ').join('');
90
+ before += Array(diff).fill(' ').join('')
133
91
  }
134
92
 
135
- return before;
93
+ return before
136
94
  }
137
- /**
138
- * Remove visual cascade
139
- */
140
- ;
141
-
142
- _proto.restoreBefore = function restoreBefore(decl) {
143
- var lines = decl.raw('before').split('\n');
144
- var min = lines[lines.length - 1];
145
- this.all.group(decl).up(function (prefixed) {
146
- var array = prefixed.raw('before').split('\n');
147
- var last = array[array.length - 1];
148
95
 
96
+ /**
97
+ * Remove visual cascade
98
+ */
99
+ restoreBefore (decl) {
100
+ let lines = decl.raw('before').split('\n')
101
+ let min = lines[lines.length - 1]
102
+
103
+ this.all.group(decl).up(prefixed => {
104
+ let array = prefixed.raw('before').split('\n')
105
+ let last = array[array.length - 1]
149
106
  if (last.length < min.length) {
150
- min = last;
107
+ min = last
151
108
  }
152
- });
153
- lines[lines.length - 1] = min;
154
- decl.raws.before = lines.join('\n');
155
- }
156
- /**
157
- * Clone and insert new declaration
158
- */
159
- ;
109
+ })
160
110
 
161
- _proto.insert = function insert(decl, prefix, prefixes) {
162
- var cloned = this.set(this.clone(decl), prefix);
163
- if (!cloned) return undefined;
164
- var already = decl.parent.some(function (i) {
165
- return i.prop === cloned.prop && i.value === cloned.value;
166
- });
111
+ lines[lines.length - 1] = min
112
+ decl.raws.before = lines.join('\n')
113
+ }
167
114
 
115
+ /**
116
+ * Clone and insert new declaration
117
+ */
118
+ insert (decl, prefix, prefixes) {
119
+ let cloned = this.set(this.clone(decl), prefix)
120
+ if (!cloned) return undefined
121
+
122
+ let already = decl.parent.some(
123
+ i => i.prop === cloned.prop && i.value === cloned.value
124
+ )
168
125
  if (already) {
169
- return undefined;
126
+ return undefined
170
127
  }
171
128
 
172
129
  if (this.needCascade(decl)) {
173
- cloned.raws.before = this.calcBefore(prefixes, decl, prefix);
130
+ cloned.raws.before = this.calcBefore(prefixes, decl, prefix)
174
131
  }
175
-
176
- return decl.parent.insertBefore(decl, cloned);
132
+ return decl.parent.insertBefore(decl, cloned)
177
133
  }
178
- /**
179
- * Did this declaration has this prefix above
180
- */
181
- ;
182
-
183
- _proto.isAlready = function isAlready(decl, prefixed) {
184
- var already = this.all.group(decl).up(function (i) {
185
- return i.prop === prefixed;
186
- });
187
134
 
135
+ /**
136
+ * Did this declaration has this prefix above
137
+ */
138
+ isAlready (decl, prefixed) {
139
+ let already = this.all.group(decl).up(i => i.prop === prefixed)
188
140
  if (!already) {
189
- already = this.all.group(decl).down(function (i) {
190
- return i.prop === prefixed;
191
- });
141
+ already = this.all.group(decl).down(i => i.prop === prefixed)
192
142
  }
193
-
194
- return already;
143
+ return already
195
144
  }
196
- /**
197
- * Clone and add prefixes for declaration
198
- */
199
- ;
200
-
201
- _proto.add = function add(decl, prefix, prefixes, result) {
202
- var prefixed = this.prefixed(decl.prop, prefix);
203
145
 
204
- if (this.isAlready(decl, prefixed) || this.otherPrefixes(decl.value, prefix)) {
205
- return undefined;
146
+ /**
147
+ * Clone and add prefixes for declaration
148
+ */
149
+ add (decl, prefix, prefixes, result) {
150
+ let prefixed = this.prefixed(decl.prop, prefix)
151
+ if (
152
+ this.isAlready(decl, prefixed) ||
153
+ this.otherPrefixes(decl.value, prefix)
154
+ ) {
155
+ return undefined
206
156
  }
207
-
208
- return this.insert(decl, prefix, prefixes, result);
157
+ return this.insert(decl, prefix, prefixes, result)
209
158
  }
210
- /**
211
- * Add spaces for visual cascade
212
- */
213
- ;
214
159
 
215
- _proto.process = function process(decl, result) {
160
+ /**
161
+ * Add spaces for visual cascade
162
+ */
163
+ process (decl, result) {
216
164
  if (!this.needCascade(decl)) {
217
- _Prefixer.prototype.process.call(this, decl, result);
218
-
219
- return;
165
+ super.process(decl, result)
166
+ return
220
167
  }
221
168
 
222
- var prefixes = _Prefixer.prototype.process.call(this, decl, result);
169
+ let prefixes = super.process(decl, result)
223
170
 
224
171
  if (!prefixes || !prefixes.length) {
225
- return;
172
+ return
226
173
  }
227
174
 
228
- this.restoreBefore(decl);
229
- decl.raws.before = this.calcBefore(prefixes, decl);
175
+ this.restoreBefore(decl)
176
+ decl.raws.before = this.calcBefore(prefixes, decl)
230
177
  }
231
- /**
232
- * Return list of prefixed properties to clean old prefixes
233
- */
234
- ;
235
178
 
236
- _proto.old = function old(prop, prefix) {
237
- return [this.prefixed(prop, prefix)];
238
- };
239
-
240
- return Declaration;
241
- }(Prefixer);
179
+ /**
180
+ * Return list of prefixed properties to clean old prefixes
181
+ */
182
+ old (prop, prefix) {
183
+ return [this.prefixed(prop, prefix)]
184
+ }
185
+ }
242
186
 
243
- module.exports = Declaration;
187
+ module.exports = Declaration
@@ -1,79 +1,49 @@
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 AlignContent = /*#__PURE__*/function (_Declaration) {
14
- _inheritsLoose(AlignContent, _Declaration);
15
-
16
- function AlignContent() {
17
- return _Declaration.apply(this, arguments) || this;
18
- }
19
-
20
- var _proto = AlignContent.prototype;
1
+ let flexSpec = require('./flex-spec')
2
+ let Declaration = require('../declaration')
21
3
 
4
+ class AlignContent extends Declaration {
22
5
  /**
23
6
  * Change property name for 2012 spec
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 === 2012) {
34
- return prefix + 'flex-line-pack';
12
+ return prefix + 'flex-line-pack'
35
13
  }
36
-
37
- return _Declaration.prototype.prefixed.call(this, prop, prefix);
14
+ return super.prefixed(prop, prefix)
38
15
  }
16
+
39
17
  /**
40
18
  * Return property name by final spec
41
19
  */
42
- ;
43
-
44
- _proto.normalize = function normalize() {
45
- return 'align-content';
20
+ normalize () {
21
+ return 'align-content'
46
22
  }
23
+
47
24
  /**
48
25
  * Change value for 2012 spec and ignore prefix for 2009
49
26
  */
50
- ;
51
-
52
- _proto.set = function set(decl, prefix) {
53
- var spec = flexSpec(prefix)[0];
54
-
27
+ set (decl, prefix) {
28
+ let spec = flexSpec(prefix)[0]
55
29
  if (spec === 2012) {
56
- decl.value = AlignContent.oldValues[decl.value] || decl.value;
57
- return _Declaration.prototype.set.call(this, decl, prefix);
30
+ decl.value = AlignContent.oldValues[decl.value] || decl.value
31
+ return super.set(decl, prefix)
58
32
  }
59
-
60
33
  if (spec === 'final') {
61
- return _Declaration.prototype.set.call(this, decl, prefix);
34
+ return super.set(decl, prefix)
62
35
  }
36
+ return undefined
37
+ }
38
+ }
63
39
 
64
- return undefined;
65
- };
66
-
67
- return AlignContent;
68
- }(Declaration);
69
-
70
- _defineProperty(AlignContent, "names", ['align-content', 'flex-line-pack']);
40
+ AlignContent.names = ['align-content', 'flex-line-pack']
71
41
 
72
- _defineProperty(AlignContent, "oldValues", {
42
+ AlignContent.oldValues = {
73
43
  'flex-end': 'end',
74
44
  'flex-start': 'start',
75
45
  'space-between': 'justify',
76
46
  'space-around': 'distribute'
77
- });
47
+ }
78
48
 
79
- module.exports = AlignContent;
49
+ module.exports = AlignContent
@@ -1,76 +1,46 @@
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 AlignItems = /*#__PURE__*/function (_Declaration) {
14
- _inheritsLoose(AlignItems, _Declaration);
15
-
16
- function AlignItems() {
17
- return _Declaration.apply(this, arguments) || this;
18
- }
19
-
20
- var _proto = AlignItems.prototype;
1
+ let flexSpec = require('./flex-spec')
2
+ let Declaration = require('../declaration')
21
3
 
4
+ class AlignItems 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-align';
12
+ return prefix + 'box-align'
35
13
  }
36
-
37
14
  if (spec === 2012) {
38
- return prefix + 'flex-align';
15
+ return prefix + 'flex-align'
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 'align-items';
23
+ normalize () {
24
+ return 'align-items'
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
- decl.value = AlignItems.oldValues[decl.value] || decl.value;
33
+ decl.value = AlignItems.oldValues[decl.value] || decl.value
61
34
  }
35
+ return super.set(decl, prefix)
36
+ }
37
+ }
62
38
 
63
- return _Declaration.prototype.set.call(this, decl, prefix);
64
- };
65
-
66
- return AlignItems;
67
- }(Declaration);
68
-
69
- _defineProperty(AlignItems, "names", ['align-items', 'flex-align', 'box-align']);
39
+ AlignItems.names = ['align-items', 'flex-align', 'box-align']
70
40
 
71
- _defineProperty(AlignItems, "oldValues", {
41
+ AlignItems.oldValues = {
72
42
  'flex-end': 'end',
73
43
  'flex-start': 'start'
74
- });
44
+ }
75
45
 
76
- module.exports = AlignItems;
46
+ module.exports = AlignItems
@@ -1,84 +1,56 @@
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 AlignSelf = /*#__PURE__*/function (_Declaration) {
14
- _inheritsLoose(AlignSelf, _Declaration);
15
-
16
- function AlignSelf() {
17
- return _Declaration.apply(this, arguments) || this;
1
+ let flexSpec = require('./flex-spec')
2
+ let Declaration = require('../declaration')
3
+
4
+ class AlignSelf extends Declaration {
5
+ check (decl) {
6
+ return (
7
+ decl.parent &&
8
+ !decl.parent.some(i => {
9
+ return i.prop && i.prop.startsWith('grid-')
10
+ })
11
+ )
18
12
  }
19
13
 
20
- var _proto = AlignSelf.prototype;
21
-
22
- _proto.check = function check(decl) {
23
- return decl.parent && !decl.parent.some(function (i) {
24
- return i.prop && i.prop.startsWith('grid-');
25
- });
26
- }
27
14
  /**
28
15
  * Change property name for 2012 specs
29
16
  */
30
- ;
31
-
32
- _proto.prefixed = function prefixed(prop, prefix) {
33
- var spec;
34
-
35
- var _flexSpec = flexSpec(prefix);
36
-
37
- spec = _flexSpec[0];
38
- prefix = _flexSpec[1];
39
-
17
+ prefixed (prop, prefix) {
18
+ let spec
19
+ ;[spec, prefix] = flexSpec(prefix)
40
20
  if (spec === 2012) {
41
- return prefix + 'flex-item-align';
21
+ return prefix + 'flex-item-align'
42
22
  }
43
-
44
- return _Declaration.prototype.prefixed.call(this, prop, prefix);
23
+ return super.prefixed(prop, prefix)
45
24
  }
25
+
46
26
  /**
47
27
  * Return property name by final spec
48
28
  */
49
- ;
50
-
51
- _proto.normalize = function normalize() {
52
- return 'align-self';
29
+ normalize () {
30
+ return 'align-self'
53
31
  }
32
+
54
33
  /**
55
34
  * Change value for 2012 spec and ignore prefix for 2009
56
35
  */
57
- ;
58
-
59
- _proto.set = function set(decl, prefix) {
60
- var spec = flexSpec(prefix)[0];
61
-
36
+ set (decl, prefix) {
37
+ let spec = flexSpec(prefix)[0]
62
38
  if (spec === 2012) {
63
- decl.value = AlignSelf.oldValues[decl.value] || decl.value;
64
- return _Declaration.prototype.set.call(this, decl, prefix);
39
+ decl.value = AlignSelf.oldValues[decl.value] || decl.value
40
+ return super.set(decl, prefix)
65
41
  }
66
-
67
42
  if (spec === 'final') {
68
- return _Declaration.prototype.set.call(this, decl, prefix);
43
+ return super.set(decl, prefix)
69
44
  }
45
+ return undefined
46
+ }
47
+ }
70
48
 
71
- return undefined;
72
- };
73
-
74
- return AlignSelf;
75
- }(Declaration);
76
-
77
- _defineProperty(AlignSelf, "names", ['align-self', 'flex-item-align']);
49
+ AlignSelf.names = ['align-self', 'flex-item-align']
78
50
 
79
- _defineProperty(AlignSelf, "oldValues", {
51
+ AlignSelf.oldValues = {
80
52
  'flex-end': 'end',
81
53
  'flex-start': 'start'
82
- });
54
+ }
83
55
 
84
- module.exports = AlignSelf;
56
+ module.exports = AlignSelf