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,52 +1,34 @@
1
- "use strict";
1
+ let Declaration = require('../declaration')
2
+ let utils = require('./grid-utils')
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); }
4
+ class GridArea extends Declaration {
5
+ /**
6
+ * Translate grid-area to separate -ms- prefixed properties
7
+ */
8
+ insert (decl, prefix, prefixes, result) {
9
+ if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes)
6
10
 
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; }
11
+ let values = utils.parse(decl)
8
12
 
9
- var Declaration = require('../declaration');
13
+ let [rowStart, rowSpan] = utils.translate(values, 0, 2)
14
+ let [columnStart, columnSpan] = utils.translate(values, 1, 3)
10
15
 
11
- var utils = require('./grid-utils');
16
+ ;[
17
+ ['grid-row', rowStart],
18
+ ['grid-row-span', rowSpan],
19
+ ['grid-column', columnStart],
20
+ ['grid-column-span', columnSpan]
21
+ ].forEach(([prop, value]) => {
22
+ utils.insertDecl(decl, prop, value)
23
+ })
12
24
 
13
- var GridArea = /*#__PURE__*/function (_Declaration) {
14
- _inheritsLoose(GridArea, _Declaration);
25
+ utils.warnTemplateSelectorNotFound(decl, result)
26
+ utils.warnIfGridRowColumnExists(decl, result)
15
27
 
16
- function GridArea() {
17
- return _Declaration.apply(this, arguments) || this;
28
+ return undefined
18
29
  }
30
+ }
19
31
 
20
- var _proto = GridArea.prototype;
32
+ GridArea.names = ['grid-area']
21
33
 
22
- /**
23
- * Translate grid-area to separate -ms- prefixed properties
24
- */
25
- _proto.insert = function insert(decl, prefix, prefixes, result) {
26
- if (prefix !== '-ms-') return _Declaration.prototype.insert.call(this, decl, prefix, prefixes);
27
- var values = utils.parse(decl);
28
-
29
- var _utils$translate = utils.translate(values, 0, 2),
30
- rowStart = _utils$translate[0],
31
- rowSpan = _utils$translate[1];
32
-
33
- var _utils$translate2 = utils.translate(values, 1, 3),
34
- columnStart = _utils$translate2[0],
35
- columnSpan = _utils$translate2[1];
36
-
37
- [['grid-row', rowStart], ['grid-row-span', rowSpan], ['grid-column', columnStart], ['grid-column-span', columnSpan]].forEach(function (_ref) {
38
- var prop = _ref[0],
39
- value = _ref[1];
40
- utils.insertDecl(decl, prop, value);
41
- });
42
- utils.warnTemplateSelectorNotFound(decl, result);
43
- utils.warnIfGridRowColumnExists(decl, result);
44
- return undefined;
45
- };
46
-
47
- return GridArea;
48
- }(Declaration);
49
-
50
- _defineProperty(GridArea, "names", ['grid-area']);
51
-
52
- module.exports = GridArea;
34
+ module.exports = GridArea
@@ -1,48 +1,28 @@
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 GridColumnAlign = /*#__PURE__*/function (_Declaration) {
12
- _inheritsLoose(GridColumnAlign, _Declaration);
13
-
14
- function GridColumnAlign() {
15
- return _Declaration.apply(this, arguments) || this;
16
- }
17
-
18
- var _proto = GridColumnAlign.prototype;
1
+ let Declaration = require('../declaration')
19
2
 
3
+ class GridColumnAlign extends Declaration {
20
4
  /**
21
5
  * Do not prefix flexbox values
22
6
  */
23
- _proto.check = function check(decl) {
24
- return !decl.value.includes('flex-') && decl.value !== 'baseline';
7
+ check (decl) {
8
+ return !decl.value.includes('flex-') && decl.value !== 'baseline'
25
9
  }
10
+
26
11
  /**
27
12
  * Change property name for IE
28
13
  */
29
- ;
30
-
31
- _proto.prefixed = function prefixed(prop, prefix) {
32
- return prefix + 'grid-column-align';
14
+ prefixed (prop, prefix) {
15
+ return prefix + 'grid-column-align'
33
16
  }
17
+
34
18
  /**
35
19
  * Change IE property back
36
20
  */
37
- ;
38
-
39
- _proto.normalize = function normalize() {
40
- return 'justify-self';
41
- };
42
-
43
- return GridColumnAlign;
44
- }(Declaration);
21
+ normalize () {
22
+ return 'justify-self'
23
+ }
24
+ }
45
25
 
46
- _defineProperty(GridColumnAlign, "names", ['grid-column-align']);
26
+ GridColumnAlign.names = ['grid-column-align']
47
27
 
48
- module.exports = GridColumnAlign;
28
+ module.exports = GridColumnAlign
@@ -1,62 +1,47 @@
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 GridEnd = /*#__PURE__*/function (_Declaration) {
12
- _inheritsLoose(GridEnd, _Declaration);
13
-
14
- function GridEnd() {
15
- return _Declaration.apply(this, arguments) || this;
16
- }
17
-
18
- var _proto = GridEnd.prototype;
1
+ let Declaration = require('../declaration')
19
2
 
3
+ class GridEnd extends Declaration {
20
4
  /**
21
5
  * Change repeating syntax for IE
22
6
  */
23
- _proto.insert = function insert(decl, prefix, prefixes, result) {
24
- if (prefix !== '-ms-') return _Declaration.prototype.insert.call(this, decl, prefix, prefixes);
25
- var clonedDecl = this.clone(decl);
26
- var startProp = decl.prop.replace(/end$/, 'start');
27
- var spanProp = prefix + decl.prop.replace(/end$/, 'span');
28
-
29
- if (decl.parent.some(function (i) {
30
- return i.prop === spanProp;
31
- })) {
32
- return undefined;
7
+ insert (decl, prefix, prefixes, result) {
8
+ if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes)
9
+
10
+ let clonedDecl = this.clone(decl)
11
+
12
+ let startProp = decl.prop.replace(/end$/, 'start')
13
+ let spanProp = prefix + decl.prop.replace(/end$/, 'span')
14
+
15
+ if (decl.parent.some(i => i.prop === spanProp)) {
16
+ return undefined
33
17
  }
34
18
 
35
- clonedDecl.prop = spanProp;
19
+ clonedDecl.prop = spanProp
36
20
 
37
21
  if (decl.value.includes('span')) {
38
- clonedDecl.value = decl.value.replace(/span\s/i, '');
22
+ clonedDecl.value = decl.value.replace(/span\s/i, '')
39
23
  } else {
40
- var startDecl;
41
- decl.parent.walkDecls(startProp, function (d) {
42
- startDecl = d;
43
- });
44
-
24
+ let startDecl
25
+ decl.parent.walkDecls(startProp, d => {
26
+ startDecl = d
27
+ })
45
28
  if (startDecl) {
46
- var value = Number(decl.value) - Number(startDecl.value) + '';
47
- clonedDecl.value = value;
29
+ let value = Number(decl.value) - Number(startDecl.value) + ''
30
+ clonedDecl.value = value
48
31
  } else {
49
- decl.warn(result, "Can not prefix " + decl.prop + " (" + startProp + " is not found)");
32
+ decl.warn(
33
+ result,
34
+ `Can not prefix ${decl.prop} (${startProp} is not found)`
35
+ )
50
36
  }
51
37
  }
52
38
 
53
- decl.cloneBefore(clonedDecl);
54
- return undefined;
55
- };
39
+ decl.cloneBefore(clonedDecl)
56
40
 
57
- return GridEnd;
58
- }(Declaration);
41
+ return undefined
42
+ }
43
+ }
59
44
 
60
- _defineProperty(GridEnd, "names", ['grid-row-end', 'grid-column-end']);
45
+ GridEnd.names = ['grid-row-end', 'grid-column-end']
61
46
 
62
- module.exports = GridEnd;
47
+ module.exports = GridEnd
@@ -1,48 +1,28 @@
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 GridRowAlign = /*#__PURE__*/function (_Declaration) {
12
- _inheritsLoose(GridRowAlign, _Declaration);
13
-
14
- function GridRowAlign() {
15
- return _Declaration.apply(this, arguments) || this;
16
- }
17
-
18
- var _proto = GridRowAlign.prototype;
1
+ let Declaration = require('../declaration')
19
2
 
3
+ class GridRowAlign extends Declaration {
20
4
  /**
21
5
  * Do not prefix flexbox values
22
6
  */
23
- _proto.check = function check(decl) {
24
- return !decl.value.includes('flex-') && decl.value !== 'baseline';
7
+ check (decl) {
8
+ return !decl.value.includes('flex-') && decl.value !== 'baseline'
25
9
  }
10
+
26
11
  /**
27
12
  * Change property name for IE
28
13
  */
29
- ;
30
-
31
- _proto.prefixed = function prefixed(prop, prefix) {
32
- return prefix + 'grid-row-align';
14
+ prefixed (prop, prefix) {
15
+ return prefix + 'grid-row-align'
33
16
  }
17
+
34
18
  /**
35
19
  * Change IE property back
36
20
  */
37
- ;
38
-
39
- _proto.normalize = function normalize() {
40
- return 'align-self';
41
- };
42
-
43
- return GridRowAlign;
44
- }(Declaration);
21
+ normalize () {
22
+ return 'align-self'
23
+ }
24
+ }
45
25
 
46
- _defineProperty(GridRowAlign, "names", ['grid-row-align']);
26
+ GridRowAlign.names = ['grid-row-align']
47
27
 
48
- module.exports = GridRowAlign;
28
+ module.exports = GridRowAlign
@@ -1,52 +1,33 @@
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 utils = require('./grid-utils');
12
-
13
- var GridRowColumn = /*#__PURE__*/function (_Declaration) {
14
- _inheritsLoose(GridRowColumn, _Declaration);
15
-
16
- function GridRowColumn() {
17
- return _Declaration.apply(this, arguments) || this;
18
- }
19
-
20
- var _proto = GridRowColumn.prototype;
1
+ let Declaration = require('../declaration')
2
+ let utils = require('./grid-utils')
21
3
 
4
+ class GridRowColumn extends Declaration {
22
5
  /**
23
6
  * Translate grid-row / grid-column to separate -ms- prefixed properties
24
7
  */
25
- _proto.insert = function insert(decl, prefix, prefixes) {
26
- if (prefix !== '-ms-') return _Declaration.prototype.insert.call(this, decl, prefix, prefixes);
27
- var values = utils.parse(decl);
8
+ insert (decl, prefix, prefixes) {
9
+ if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes)
28
10
 
29
- var _utils$translate = utils.translate(values, 0, 1),
30
- start = _utils$translate[0],
31
- span = _utils$translate[1];
11
+ let values = utils.parse(decl)
12
+ let [start, span] = utils.translate(values, 0, 1)
32
13
 
33
- var hasStartValueSpan = values[0] && values[0].includes('span');
14
+ let hasStartValueSpan = values[0] && values[0].includes('span')
34
15
 
35
16
  if (hasStartValueSpan) {
36
- span = values[0].join('').replace(/\D/g, '');
17
+ span = values[0].join('').replace(/\D/g, '')
37
18
  }
38
19
 
39
- [[decl.prop, start], [decl.prop + "-span", span]].forEach(function (_ref) {
40
- var prop = _ref[0],
41
- value = _ref[1];
42
- utils.insertDecl(decl, prop, value);
43
- });
44
- return undefined;
45
- };
20
+ ;[
21
+ [decl.prop, start],
22
+ [`${decl.prop}-span`, span]
23
+ ].forEach(([prop, value]) => {
24
+ utils.insertDecl(decl, prop, value)
25
+ })
46
26
 
47
- return GridRowColumn;
48
- }(Declaration);
27
+ return undefined
28
+ }
29
+ }
49
30
 
50
- _defineProperty(GridRowColumn, "names", ['grid-row', 'grid-column']);
31
+ GridRowColumn.names = ['grid-row', 'grid-column']
51
32
 
52
- module.exports = GridRowColumn;
33
+ module.exports = GridRowColumn
@@ -1,149 +1,125 @@
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 _require = require('./grid-utils'),
12
- prefixTrackProp = _require.prefixTrackProp,
13
- prefixTrackValue = _require.prefixTrackValue,
14
- autoplaceGridItems = _require.autoplaceGridItems,
15
- getGridGap = _require.getGridGap,
16
- inheritGridGap = _require.inheritGridGap;
17
-
18
- var Processor = require('../processor');
19
-
20
- var GridRowsColumns = /*#__PURE__*/function (_Declaration) {
21
- _inheritsLoose(GridRowsColumns, _Declaration);
22
-
23
- function GridRowsColumns() {
24
- return _Declaration.apply(this, arguments) || this;
25
- }
26
-
27
- var _proto = GridRowsColumns.prototype;
28
-
1
+ let Declaration = require('../declaration')
2
+ let {
3
+ prefixTrackProp,
4
+ prefixTrackValue,
5
+ autoplaceGridItems,
6
+ getGridGap,
7
+ inheritGridGap
8
+ } = require('./grid-utils')
9
+ let Processor = require('../processor')
10
+
11
+ class GridRowsColumns extends Declaration {
29
12
  /**
30
13
  * Change property name for IE
31
14
  */
32
- _proto.prefixed = function prefixed(prop, prefix) {
15
+ prefixed (prop, prefix) {
33
16
  if (prefix === '-ms-') {
34
- return prefixTrackProp({
35
- prop: prop,
36
- prefix: prefix
37
- });
17
+ return prefixTrackProp({ prop, prefix })
38
18
  }
39
-
40
- return _Declaration.prototype.prefixed.call(this, prop, prefix);
19
+ return super.prefixed(prop, prefix)
41
20
  }
21
+
42
22
  /**
43
23
  * Change IE property back
44
24
  */
45
- ;
46
-
47
- _proto.normalize = function normalize(prop) {
48
- return prop.replace(/^grid-(rows|columns)/, 'grid-template-$1');
49
- };
50
-
51
- _proto.insert = function insert(decl, prefix, prefixes, result) {
52
- if (prefix !== '-ms-') return _Declaration.prototype.insert.call(this, decl, prefix, prefixes);
53
- var parent = decl.parent,
54
- prop = decl.prop,
55
- value = decl.value;
56
- var isRowProp = prop.includes('rows');
57
- var isColumnProp = prop.includes('columns');
58
- var hasGridTemplate = parent.some(function (i) {
59
- return i.prop === 'grid-template' || i.prop === 'grid-template-areas';
60
- });
25
+ normalize (prop) {
26
+ return prop.replace(/^grid-(rows|columns)/, 'grid-template-$1')
27
+ }
28
+
29
+ insert (decl, prefix, prefixes, result) {
30
+ if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes)
31
+
32
+ let { parent, prop, value } = decl
33
+ let isRowProp = prop.includes('rows')
34
+ let isColumnProp = prop.includes('columns')
35
+
36
+ let hasGridTemplate = parent.some(
37
+ i => i.prop === 'grid-template' || i.prop === 'grid-template-areas'
38
+ )
39
+
61
40
  /**
62
41
  * Not to prefix rows declaration if grid-template(-areas) is present
63
42
  */
64
-
65
43
  if (hasGridTemplate && isRowProp) {
66
- return false;
44
+ return false
67
45
  }
68
46
 
69
- var processor = new Processor({
70
- options: {}
71
- });
72
- var status = processor.gridStatus(parent, result);
73
- var gap = getGridGap(decl);
74
- gap = inheritGridGap(decl, gap) || gap;
75
- var gapValue = isRowProp ? gap.row : gap.column;
47
+ let processor = new Processor({ options: {} })
48
+ let status = processor.gridStatus(parent, result)
49
+ let gap = getGridGap(decl)
50
+ gap = inheritGridGap(decl, gap) || gap
51
+
52
+ let gapValue = isRowProp ? gap.row : gap.column
76
53
 
77
54
  if ((status === 'no-autoplace' || status === true) && !hasGridTemplate) {
78
- gapValue = null;
55
+ gapValue = null
79
56
  }
80
57
 
81
- var prefixValue = prefixTrackValue({
82
- value: value,
58
+ let prefixValue = prefixTrackValue({
59
+ value,
83
60
  gap: gapValue
84
- });
61
+ })
62
+
85
63
  /**
86
64
  * Insert prefixes
87
65
  */
88
-
89
66
  decl.cloneBefore({
90
- prop: prefixTrackProp({
91
- prop: prop,
92
- prefix: prefix
93
- }),
67
+ prop: prefixTrackProp({ prop, prefix }),
94
68
  value: prefixValue
95
- });
96
- var autoflow = parent.nodes.find(function (i) {
97
- return i.prop === 'grid-auto-flow';
98
- });
99
- var autoflowValue = 'row';
69
+ })
70
+
71
+ let autoflow = parent.nodes.find(i => i.prop === 'grid-auto-flow')
72
+ let autoflowValue = 'row'
100
73
 
101
74
  if (autoflow && !processor.disabled(autoflow, result)) {
102
- autoflowValue = autoflow.value.trim();
75
+ autoflowValue = autoflow.value.trim()
103
76
  }
104
-
105
77
  if (status === 'autoplace') {
106
78
  /**
107
79
  * Show warning if grid-template-rows decl is not found
108
80
  */
109
- var rowDecl = parent.nodes.find(function (i) {
110
- return i.prop === 'grid-template-rows';
111
- });
81
+ let rowDecl = parent.nodes.find(i => i.prop === 'grid-template-rows')
112
82
 
113
83
  if (!rowDecl && hasGridTemplate) {
114
- return undefined;
84
+ return undefined
115
85
  } else if (!rowDecl && !hasGridTemplate) {
116
- decl.warn(result, 'Autoplacement does not work without grid-template-rows property');
117
- return undefined;
86
+ decl.warn(
87
+ result,
88
+ 'Autoplacement does not work without grid-template-rows property'
89
+ )
90
+ return undefined
118
91
  }
92
+
119
93
  /**
120
94
  * Show warning if grid-template-columns decl is not found
121
95
  */
122
-
123
-
124
- var columnDecl = parent.nodes.find(function (i) {
125
- return i.prop === 'grid-template-columns';
126
- });
127
-
96
+ let columnDecl = parent.nodes.find(i => {
97
+ return i.prop === 'grid-template-columns'
98
+ })
128
99
  if (!columnDecl && !hasGridTemplate) {
129
- decl.warn(result, 'Autoplacement does not work without grid-template-columns property');
100
+ decl.warn(
101
+ result,
102
+ 'Autoplacement does not work without grid-template-columns property'
103
+ )
130
104
  }
105
+
131
106
  /**
132
107
  * Autoplace grid items
133
108
  */
134
-
135
-
136
109
  if (isColumnProp && !hasGridTemplate) {
137
- autoplaceGridItems(decl, result, gap, autoflowValue);
110
+ autoplaceGridItems(decl, result, gap, autoflowValue)
138
111
  }
139
112
  }
140
113
 
141
- return undefined;
142
- };
143
-
144
- return GridRowsColumns;
145
- }(Declaration);
114
+ return undefined
115
+ }
116
+ }
146
117
 
147
- _defineProperty(GridRowsColumns, "names", ['grid-template-rows', 'grid-template-columns', 'grid-rows', 'grid-columns']);
118
+ GridRowsColumns.names = [
119
+ 'grid-template-rows',
120
+ 'grid-template-columns',
121
+ 'grid-rows',
122
+ 'grid-columns'
123
+ ]
148
124
 
149
- module.exports = GridRowsColumns;
125
+ module.exports = GridRowsColumns
@@ -1,55 +1,33 @@
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 GridStart = /*#__PURE__*/function (_Declaration) {
12
- _inheritsLoose(GridStart, _Declaration);
13
-
14
- function GridStart() {
15
- return _Declaration.apply(this, arguments) || this;
16
- }
17
-
18
- var _proto = GridStart.prototype;
1
+ let Declaration = require('../declaration')
19
2
 
3
+ class GridStart extends Declaration {
20
4
  /**
21
5
  * Do not add prefix for unsupported value in IE
22
6
  */
23
- _proto.check = function check(decl) {
24
- var value = decl.value;
25
- return !value.includes('/') || value.includes('span');
7
+ check (decl) {
8
+ let value = decl.value
9
+ return !value.includes('/') || value.includes('span')
26
10
  }
11
+
27
12
  /**
28
13
  * Return a final spec property
29
14
  */
30
- ;
31
-
32
- _proto.normalize = function normalize(prop) {
33
- return prop.replace('-start', '');
15
+ normalize (prop) {
16
+ return prop.replace('-start', '')
34
17
  }
18
+
35
19
  /**
36
20
  * Change property name for IE
37
21
  */
38
- ;
39
-
40
- _proto.prefixed = function prefixed(prop, prefix) {
41
- var result = _Declaration.prototype.prefixed.call(this, prop, prefix);
42
-
22
+ prefixed (prop, prefix) {
23
+ let result = super.prefixed(prop, prefix)
43
24
  if (prefix === '-ms-') {
44
- result = result.replace('-start', '');
25
+ result = result.replace('-start', '')
45
26
  }
27
+ return result
28
+ }
29
+ }
46
30
 
47
- return result;
48
- };
49
-
50
- return GridStart;
51
- }(Declaration);
52
-
53
- _defineProperty(GridStart, "names", ['grid-row-start', 'grid-column-start']);
31
+ GridStart.names = ['grid-row-start', 'grid-column-start']
54
32
 
55
- module.exports = GridStart;
33
+ module.exports = GridStart