autoprefixer 6.7.1 → 6.7.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 6.7.2
2
+ * Do not prefix grid/flexbox in `@supports` on `grid: false`/`flexbox: false`.
3
+
1
4
  ## 6.7.1
2
5
  * Update Browserslist with `last n version` fix.
3
6
 
package/lib/supports.js CHANGED
@@ -68,10 +68,12 @@
68
68
  };
69
69
 
70
70
  Supports.prototype.prefixed = function(str) {
71
- var decl, j, k, len, len1, prefixer, prop, ref1, ref2, rule, value;
71
+ var decl, j, k, len, len1, prefixer, ref1, ref2, rule, value;
72
72
  rule = this.virtual(str);
73
- prop = rule.first.prop;
74
- prefixer = this.prefixer().add[prop];
73
+ if (this.disabled(rule.first)) {
74
+ return rule.nodes;
75
+ }
76
+ prefixer = this.prefixer().add[rule.first.prop];
75
77
  if (prefixer != null) {
76
78
  if (typeof prefixer.process === "function") {
77
79
  prefixer.process(rule.first);
@@ -80,7 +82,7 @@
80
82
  ref1 = rule.nodes;
81
83
  for (j = 0, len = ref1.length; j < len; j++) {
82
84
  decl = ref1[j];
83
- ref2 = this.prefixer().values('add', prop);
85
+ ref2 = this.prefixer().values('add', rule.first.prop);
84
86
  for (k = 0, len1 = ref2.length; k < len1; k++) {
85
87
  value = ref2[k];
86
88
  value.process(decl);
@@ -222,6 +224,28 @@
222
224
  return rule.params = brackets.stringify(ast);
223
225
  };
224
226
 
227
+ Supports.prototype.disabled = function(node) {
228
+ var other;
229
+ if (this.all.options.grid === false) {
230
+ if (node.prop === 'display' && node.value.indexOf('grid') !== -1) {
231
+ return true;
232
+ }
233
+ if (node.prop.indexOf('grid') !== -1 || node.prop === 'justify-items') {
234
+ return true;
235
+ }
236
+ }
237
+ if (this.all.options.flexbox === false) {
238
+ if (node.prop === 'display' && node.value.indexOf('flex') !== -1) {
239
+ return true;
240
+ }
241
+ other = ['order', 'justify-content', 'align-items', 'align-content'];
242
+ if (node.prop.indexOf('flex') !== -1 || other.indexOf(node.prop) !== -1) {
243
+ return true;
244
+ }
245
+ }
246
+ return false;
247
+ };
248
+
225
249
  return Supports;
226
250
 
227
251
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autoprefixer",
3
- "version": "6.7.1",
3
+ "version": "6.7.2",
4
4
  "description": "Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website",
5
5
  "keywords": [
6
6
  "autoprefixer",
@@ -14,7 +14,7 @@
14
14
  "repository": "postcss/autoprefixer",
15
15
  "dependencies": {
16
16
  "browserslist": "^1.7.1",
17
- "caniuse-db": "^1.0.30000617",
17
+ "caniuse-db": "^1.0.30000618",
18
18
  "normalize-range": "^0.1.2",
19
19
  "num2fraction": "^1.2.2",
20
20
  "postcss": "^5.2.11",