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.
Files changed (66) hide show
  1. package/AUTHORS +1 -0
  2. package/CHANGELOG.md +23 -0
  3. package/README.md +9 -15
  4. package/data/prefixes.js +551 -517
  5. package/lib/at-rule.js +55 -38
  6. package/lib/autoprefixer.js +89 -63
  7. package/lib/brackets.js +59 -39
  8. package/lib/browsers.js +102 -65
  9. package/lib/declaration.js +212 -121
  10. package/lib/hacks/align-content.js +65 -38
  11. package/lib/hacks/align-items.js +62 -38
  12. package/lib/hacks/align-self.js +63 -36
  13. package/lib/hacks/appearance.js +42 -0
  14. package/lib/hacks/background-size.js +29 -20
  15. package/lib/hacks/block-logical.js +36 -21
  16. package/lib/hacks/border-image.js +26 -16
  17. package/lib/hacks/border-radius.js +60 -39
  18. package/lib/hacks/break-props.js +69 -44
  19. package/lib/hacks/cross-fade.js +40 -37
  20. package/lib/hacks/display-flex.js +81 -31
  21. package/lib/hacks/display-grid.js +29 -19
  22. package/lib/hacks/filter-value.js +66 -45
  23. package/lib/hacks/filter.js +26 -17
  24. package/lib/hacks/flex-basis.js +60 -30
  25. package/lib/hacks/flex-direction.js +85 -53
  26. package/lib/hacks/flex-flow.js +67 -49
  27. package/lib/hacks/flex-grow.js +45 -26
  28. package/lib/hacks/flex-shrink.js +60 -30
  29. package/lib/hacks/flex-spec.js +18 -8
  30. package/lib/hacks/flex-values.js +39 -20
  31. package/lib/hacks/flex-wrap.js +29 -20
  32. package/lib/hacks/flex.js +68 -43
  33. package/lib/hacks/fullscreen.js +31 -21
  34. package/lib/hacks/gradient.js +462 -302
  35. package/lib/hacks/grid-column-align.js +55 -0
  36. package/lib/hacks/grid-end.js +53 -28
  37. package/lib/hacks/grid-row-align.js +39 -19
  38. package/lib/hacks/grid-start.js +80 -48
  39. package/lib/hacks/grid-template.js +91 -55
  40. package/lib/hacks/image-rendering.js +63 -33
  41. package/lib/hacks/image-set.js +28 -20
  42. package/lib/hacks/inline-logical.js +32 -17
  43. package/lib/hacks/intrinsic.js +73 -0
  44. package/lib/hacks/justify-content.js +69 -42
  45. package/lib/hacks/mask-border.js +36 -21
  46. package/lib/hacks/order.js +58 -35
  47. package/lib/hacks/pixelated.js +44 -30
  48. package/lib/hacks/placeholder.js +40 -25
  49. package/lib/hacks/text-emphasis-position.js +27 -20
  50. package/lib/hacks/transform-decl.js +94 -52
  51. package/lib/hacks/writing-mode.js +37 -27
  52. package/lib/info.js +117 -78
  53. package/lib/old-selector.js +84 -58
  54. package/lib/old-value.js +22 -20
  55. package/lib/prefixer.js +164 -95
  56. package/lib/prefixes.js +446 -351
  57. package/lib/processor.js +394 -278
  58. package/lib/resolution.js +135 -75
  59. package/lib/selector.js +145 -84
  60. package/lib/supports.js +330 -210
  61. package/lib/transition.js +396 -243
  62. package/lib/utils.js +84 -48
  63. package/lib/value.js +118 -80
  64. package/package.json +53 -13
  65. package/lib/hacks/justify-items.js +0 -31
  66. package/lib/hacks/stretch.js +0 -45
@@ -1,33 +1,42 @@
1
- (function() {
2
- var Declaration, FlexWrap, 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
- flexSpec = require('./flex-spec');
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
4
 
8
- Declaration = require('../declaration');
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
- FlexWrap = (function(superClass) {
11
- extend(FlexWrap, superClass);
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 FlexWrap = function (_Declaration) {
13
+ _inherits(FlexWrap, _Declaration);
12
14
 
13
15
  function FlexWrap() {
14
- return FlexWrap.__super__.constructor.apply(this, arguments);
15
- }
16
+ _classCallCheck(this, FlexWrap);
16
17
 
17
- FlexWrap.names = ['flex-wrap'];
18
+ return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
19
+ }
18
20
 
19
- FlexWrap.prototype.set = function(decl, prefix) {
20
- var spec;
21
- spec = flexSpec(prefix)[0];
22
- if (spec !== 2009) {
23
- return FlexWrap.__super__.set.apply(this, arguments);
24
- }
21
+ /**
22
+ * Don't add prefix for 2009 spec
23
+ */
24
+ FlexWrap.prototype.set = function set(decl, prefix) {
25
+ var spec = flexSpec(prefix)[0];
26
+ if (spec !== 2009) {
27
+ return _Declaration.prototype.set.call(this, decl, prefix);
28
+ }
29
+ return undefined;
25
30
  };
26
31
 
27
32
  return FlexWrap;
33
+ }(Declaration);
28
34
 
29
- })(Declaration);
35
+ Object.defineProperty(FlexWrap, 'names', {
36
+ enumerable: true,
37
+ writable: true,
38
+ value: ['flex-wrap']
39
+ });
30
40
 
31
- module.exports = FlexWrap;
32
41
 
33
- }).call(this);
42
+ module.exports = FlexWrap;
package/lib/hacks/flex.js CHANGED
@@ -1,64 +1,89 @@
1
- (function() {
2
- var Declaration, Flex, flexSpec, list,
3
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
4
- hasProp = {}.hasOwnProperty;
1
+ 'use strict';
5
2
 
6
- flexSpec = require('./flex-spec');
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
4
 
8
- Declaration = require('../declaration');
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
- list = require('postcss/lib/list');
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; }
11
8
 
12
- Flex = (function(superClass) {
13
- extend(Flex, superClass);
9
+ var flexSpec = require('./flex-spec');
10
+ var Declaration = require('../declaration');
11
+
12
+ var list = require('postcss/lib/list');
13
+
14
+ var Flex = function (_Declaration) {
15
+ _inherits(Flex, _Declaration);
14
16
 
15
17
  function Flex() {
16
- return Flex.__super__.constructor.apply(this, arguments);
18
+ _classCallCheck(this, Flex);
19
+
20
+ return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
17
21
  }
18
22
 
19
- Flex.names = ['flex', 'box-flex'];
23
+ /**
24
+ * Change property name for 2009 spec
25
+ */
26
+ Flex.prototype.prefixed = function prefixed(prop, prefix) {
27
+ var spec = void 0;
20
28
 
21
- Flex.oldValues = {
22
- 'auto': '1',
23
- 'none': '0'
24
- };
29
+ var _flexSpec = flexSpec(prefix);
30
+
31
+ spec = _flexSpec[0];
32
+ prefix = _flexSpec[1];
25
33
 
26
- Flex.prototype.prefixed = function(prop, prefix) {
27
- var ref, spec;
28
- ref = flexSpec(prefix), spec = ref[0], prefix = ref[1];
29
- if (spec === 2009) {
30
- return prefix + 'box-flex';
31
- } else {
32
- return Flex.__super__.prefixed.apply(this, arguments);
33
- }
34
+ if (spec === 2009) {
35
+ return prefix + 'box-flex';
36
+ } else {
37
+ return _Declaration.prototype.prefixed.call(this, prop, prefix);
38
+ }
34
39
  };
35
40
 
36
- Flex.prototype.normalize = function() {
37
- return 'flex';
41
+ /**
42
+ * Return property name by final spec
43
+ */
44
+
45
+
46
+ Flex.prototype.normalize = function normalize() {
47
+ return 'flex';
38
48
  };
39
49
 
40
- Flex.prototype.set = function(decl, prefix) {
41
- var components, spec;
42
- spec = flexSpec(prefix)[0];
43
- if (spec === 2009) {
44
- decl.value = list.space(decl.value)[0];
45
- decl.value = Flex.oldValues[decl.value] || decl.value;
46
- return Flex.__super__.set.call(this, decl, prefix);
47
- } else if (spec === 2012) {
48
- components = list.space(decl.value);
49
- if (components.length === 3 && components[2] === '0') {
50
- decl.value = components.slice(0, 2).concat('0px').join(' ');
50
+ /**
51
+ * Spec 2009 supports only first argument
52
+ * Spec 2012 disallows unitless basis
53
+ */
54
+
55
+
56
+ Flex.prototype.set = function set(decl, prefix) {
57
+ var spec = flexSpec(prefix)[0];
58
+ if (spec === 2009) {
59
+ decl.value = list.space(decl.value)[0];
60
+ decl.value = Flex.oldValues[decl.value] || decl.value;
61
+ return _Declaration.prototype.set.call(this, decl, prefix);
62
+ } else if (spec === 2012) {
63
+ var components = list.space(decl.value);
64
+ if (components.length === 3 && components[2] === '0') {
65
+ decl.value = components.slice(0, 2).concat('0px').join(' ');
66
+ }
51
67
  }
52
- return Flex.__super__.set.call(this, decl, prefix);
53
- } else {
54
- return Flex.__super__.set.apply(this, arguments);
55
- }
68
+ return _Declaration.prototype.set.call(this, decl, prefix);
56
69
  };
57
70
 
58
71
  return Flex;
72
+ }(Declaration);
59
73
 
60
- })(Declaration);
74
+ Object.defineProperty(Flex, 'names', {
75
+ enumerable: true,
76
+ writable: true,
77
+ value: ['flex', 'box-flex']
78
+ });
79
+ Object.defineProperty(Flex, 'oldValues', {
80
+ enumerable: true,
81
+ writable: true,
82
+ value: {
83
+ auto: '1',
84
+ none: '0'
85
+ }
86
+ });
61
87
 
62
- module.exports = Flex;
63
88
 
64
- }).call(this);
89
+ module.exports = Flex;
@@ -1,33 +1,43 @@
1
- (function() {
2
- var Fullscreen, Selector,
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
- Selector = require('../selector');
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
4
 
8
- Fullscreen = (function(superClass) {
9
- extend(Fullscreen, superClass);
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 Selector = require('../selector');
10
+
11
+ var Fullscreen = function (_Selector) {
12
+ _inherits(Fullscreen, _Selector);
10
13
 
11
14
  function Fullscreen() {
12
- return Fullscreen.__super__.constructor.apply(this, arguments);
13
- }
15
+ _classCallCheck(this, Fullscreen);
14
16
 
15
- Fullscreen.names = [':fullscreen'];
17
+ return _possibleConstructorReturn(this, _Selector.apply(this, arguments));
18
+ }
16
19
 
17
- Fullscreen.prototype.prefixed = function(prefix) {
18
- if ('-webkit-' === prefix) {
19
- return ':-webkit-full-screen';
20
- } else if ('-moz-' === prefix) {
21
- return ':-moz-full-screen';
22
- } else {
23
- return ":" + prefix + "fullscreen";
24
- }
20
+ /**
21
+ * Return different selectors depend on prefix
22
+ */
23
+ Fullscreen.prototype.prefixed = function prefixed(prefix) {
24
+ if (prefix === '-webkit-') {
25
+ return ':-webkit-full-screen';
26
+ } else if (prefix === '-moz-') {
27
+ return ':-moz-full-screen';
28
+ } else {
29
+ return ':' + prefix + 'fullscreen';
30
+ }
25
31
  };
26
32
 
27
33
  return Fullscreen;
34
+ }(Selector);
28
35
 
29
- })(Selector);
36
+ Object.defineProperty(Fullscreen, 'names', {
37
+ enumerable: true,
38
+ writable: true,
39
+ value: [':fullscreen']
40
+ });
30
41
 
31
- module.exports = Fullscreen;
32
42
 
33
- }).call(this);
43
+ module.exports = Fullscreen;