stylecow-plugin-flex
Advanced tools
Comparing version 6.0.0 to 6.0.1
{ | ||
"name": "stylecow-plugin-flex", | ||
"description": "Stylecow plugin to add vendor prefixes and create fallback in browsers supporting the old flexbox syntax", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"engines": { | ||
@@ -19,4 +19,5 @@ "node": ">=4.0" | ||
"devDependencies": { | ||
"mocha": "^2.3.2", | ||
"stylecow-core": "^2.0.0" | ||
"mocha": "^2.3.3", | ||
"stylecow-core": "^2.1.1", | ||
"stylecow-plugin-prefixes": "^6.0.1" | ||
}, | ||
@@ -23,0 +24,0 @@ "main": "index.js", |
@@ -34,4 +34,6 @@ "use strict"; | ||
fn: function (declaration) { | ||
declaration | ||
.cloneBefore() | ||
var newDecl = declaration.clone(); | ||
declaration.getParent().unshift(newDecl); | ||
newDecl | ||
.getAll({ | ||
@@ -100,3 +102,3 @@ type: 'Keyword', | ||
declaration.codeBefore('-webkit-box-flex: ' + val, 'Declaration'); | ||
declaration.getParent().unshiftCode('-webkit-box-flex: ' + val, 'Declaration'); | ||
} | ||
@@ -128,3 +130,3 @@ } | ||
fn: function (declaration) { | ||
declaration.codeBefore('-webkit-box-ordinal-group: ' + (parseInt(declaration.join(' ')) + 1), 'Declaration'); | ||
declaration.getParent().unshiftCode('-webkit-box-ordinal-group: ' + (parseInt(declaration.join(' ')) + 1), 'Declaration'); | ||
} | ||
@@ -142,4 +144,6 @@ }); | ||
fn: function (declaration) { | ||
declaration | ||
.cloneBefore() | ||
var newDecl = declaration.clone(); | ||
declaration.getParent().unshift(newDecl); | ||
newDecl | ||
.setName(names[declaration.name]) | ||
@@ -159,12 +163,12 @@ .getAll({ | ||
case 'wrap': | ||
declaration.codeBefore('-webkit-box-lines: multiple', 'Declaration'); | ||
declaration.getParent().unshiftCode('-webkit-box-lines: multiple', 'Declaration'); | ||
break; | ||
case 'nowrap': | ||
declaration.codeBefore('-webkit-box-lines: single', 'Declaration'); | ||
declaration.getParent().unshiftCode('-webkit-box-lines: single', 'Declaration'); | ||
break; | ||
case 'wrap-reverse': | ||
declaration.codeBefore('-webkit-box-lines: multiple', 'Declaration'); | ||
declaration.codeBefore('-webkit-box-direction: reverse', 'Declaration'); | ||
declaration.getParent().unshiftCode('-webkit-box-lines: multiple', 'Declaration'); | ||
declaration.getParent().unshiftCode('-webkit-box-direction: reverse', 'Declaration'); | ||
break; | ||
@@ -177,17 +181,17 @@ } | ||
case 'row': | ||
declaration.codeBefore('-webkit-box-orient: horizontal', 'Declaration'); | ||
declaration.getParent().unshiftCode('-webkit-box-orient: horizontal', 'Declaration'); | ||
break; | ||
case 'row-reverse': | ||
declaration.codeBefore('-webkit-box-orient: horizontal', 'Declaration'); | ||
declaration.codeBefore('-webkit-box-direction: reverse', 'Declaration'); | ||
declaration.getParent().unshiftCode('-webkit-box-orient: horizontal', 'Declaration'); | ||
declaration.getParent().unshiftCode('-webkit-box-direction: reverse', 'Declaration'); | ||
break; | ||
case 'column': | ||
declaration.codeBefore('-webkit-box-orient: vertical', 'Declaration'); | ||
declaration.getParent().unshiftCode('-webkit-box-orient: vertical', 'Declaration'); | ||
break; | ||
case 'column-reverse': | ||
declaration.codeBefore('-webkit-box-orient: vertical', 'Declaration'); | ||
declaration.codeBefore('-webkit-box-direction: reverse', 'Declaration'); | ||
declaration.getParent().unshiftCode('-webkit-box-orient: vertical', 'Declaration'); | ||
declaration.getParent().unshiftCode('-webkit-box-direction: reverse', 'Declaration'); | ||
break; | ||
@@ -194,0 +198,0 @@ } |
var stylecow = require('stylecow-core'); | ||
var tests = new stylecow.Test(__dirname + '/cases'); | ||
var tasks = (new stylecow.Tasks()).use(require('../index')); | ||
var tasks = (new stylecow.Tasks()) | ||
.use(require('stylecow-plugin-prefixes')) | ||
.use(require('../index')) | ||
@@ -6,0 +8,0 @@ tests.run(function (test) { |
@@ -26,3 +26,37 @@ { | ||
"type": "Declaration", | ||
"name": "display", | ||
"name": "box-lines", | ||
"vendor": "webkit", | ||
"children": [ | ||
{ | ||
"type": "Value", | ||
"children": [ | ||
{ | ||
"type": "Keyword", | ||
"name": "multiple", | ||
"vendor": null | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "Declaration", | ||
"name": "box-orient", | ||
"vendor": "webkit", | ||
"children": [ | ||
{ | ||
"type": "Value", | ||
"children": [ | ||
{ | ||
"type": "Keyword", | ||
"name": "vertical", | ||
"vendor": null | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "Declaration", | ||
"name": "-webkit-box-align", | ||
"vendor": null, | ||
@@ -35,4 +69,4 @@ "children": [ | ||
"type": "Keyword", | ||
"name": "flexbox", | ||
"vendor": "ms" | ||
"name": "start", | ||
"vendor": null | ||
} | ||
@@ -71,3 +105,3 @@ ] | ||
"name": "flex", | ||
"vendor": null | ||
"vendor": "webkit" | ||
} | ||
@@ -80,3 +114,3 @@ ] | ||
"type": "Declaration", | ||
"name": "-ms-flex-align", | ||
"name": "display", | ||
"vendor": null, | ||
@@ -89,4 +123,4 @@ "children": [ | ||
"type": "Keyword", | ||
"name": "start", | ||
"vendor": null | ||
"name": "flexbox", | ||
"vendor": "ms" | ||
} | ||
@@ -99,3 +133,3 @@ ] | ||
"type": "Declaration", | ||
"name": "-webkit-box-align", | ||
"name": "display", | ||
"vendor": null, | ||
@@ -108,3 +142,3 @@ "children": [ | ||
"type": "Keyword", | ||
"name": "start", | ||
"name": "flex", | ||
"vendor": null | ||
@@ -119,3 +153,3 @@ } | ||
"name": "align-items", | ||
"vendor": null, | ||
"vendor": "webkit", | ||
"children": [ | ||
@@ -136,4 +170,4 @@ { | ||
"type": "Declaration", | ||
"name": "flex-flow", | ||
"vendor": "ms", | ||
"name": "-ms-flex-align", | ||
"vendor": null, | ||
"children": [ | ||
@@ -145,8 +179,20 @@ { | ||
"type": "Keyword", | ||
"name": "column", | ||
"name": "start", | ||
"vendor": null | ||
}, | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "Declaration", | ||
"name": "align-items", | ||
"vendor": null, | ||
"children": [ | ||
{ | ||
"type": "Value", | ||
"children": [ | ||
{ | ||
"type": "Keyword", | ||
"name": "wrap", | ||
"name": "flex-start", | ||
"vendor": null | ||
@@ -160,3 +206,3 @@ } | ||
"type": "Declaration", | ||
"name": "box-orient", | ||
"name": "flex-flow", | ||
"vendor": "webkit", | ||
@@ -169,4 +215,9 @@ "children": [ | ||
"type": "Keyword", | ||
"name": "vertical", | ||
"name": "column", | ||
"vendor": null | ||
}, | ||
{ | ||
"type": "Keyword", | ||
"name": "wrap", | ||
"vendor": null | ||
} | ||
@@ -179,4 +230,4 @@ ] | ||
"type": "Declaration", | ||
"name": "box-lines", | ||
"vendor": "webkit", | ||
"name": "flex-flow", | ||
"vendor": "ms", | ||
"children": [ | ||
@@ -188,4 +239,9 @@ { | ||
"type": "Keyword", | ||
"name": "multiple", | ||
"name": "column", | ||
"vendor": null | ||
}, | ||
{ | ||
"type": "Keyword", | ||
"name": "wrap", | ||
"vendor": null | ||
} | ||
@@ -252,4 +308,20 @@ ] | ||
"type": "Declaration", | ||
"name": "box-flex", | ||
"vendor": "webkit", | ||
"children": [ | ||
{ | ||
"type": "Value", | ||
"children": [ | ||
{ | ||
"type": "Number", | ||
"name": 1 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "Declaration", | ||
"name": "flex", | ||
"vendor": "ms", | ||
"vendor": "webkit", | ||
"children": [ | ||
@@ -283,4 +355,4 @@ { | ||
"type": "Declaration", | ||
"name": "box-flex", | ||
"vendor": "webkit", | ||
"name": "flex", | ||
"vendor": "ms", | ||
"children": [ | ||
@@ -293,2 +365,16 @@ { | ||
"name": 1 | ||
}, | ||
{ | ||
"type": "Number", | ||
"name": 0 | ||
}, | ||
{ | ||
"type": "Unit", | ||
"name": "%", | ||
"children": [ | ||
{ | ||
"type": "Number", | ||
"name": 100 | ||
} | ||
] | ||
} | ||
@@ -295,0 +381,0 @@ ] |
@@ -26,4 +26,4 @@ { | ||
"type": "Declaration", | ||
"name": "flex", | ||
"vendor": "ms", | ||
"name": "box-flex", | ||
"vendor": "webkit", | ||
"children": [ | ||
@@ -36,16 +36,18 @@ { | ||
"name": 1 | ||
}, | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "Declaration", | ||
"name": "flex", | ||
"vendor": "webkit", | ||
"children": [ | ||
{ | ||
"type": "Value", | ||
"children": [ | ||
{ | ||
"type": "Number", | ||
"name": 1 | ||
}, | ||
{ | ||
"type": "Unit", | ||
"name": "%", | ||
"children": [ | ||
{ | ||
"type": "Number", | ||
"name": 0 | ||
} | ||
] | ||
} | ||
@@ -58,4 +60,4 @@ ] | ||
"type": "Declaration", | ||
"name": "box-flex", | ||
"vendor": "webkit", | ||
"name": "flex", | ||
"vendor": "ms", | ||
"children": [ | ||
@@ -68,2 +70,16 @@ { | ||
"name": 1 | ||
}, | ||
{ | ||
"type": "Number", | ||
"name": 1 | ||
}, | ||
{ | ||
"type": "Unit", | ||
"name": "%", | ||
"children": [ | ||
{ | ||
"type": "Number", | ||
"name": 0 | ||
} | ||
] | ||
} | ||
@@ -130,4 +146,20 @@ ] | ||
"type": "Declaration", | ||
"name": "box-flex", | ||
"vendor": "webkit", | ||
"children": [ | ||
{ | ||
"type": "Value", | ||
"children": [ | ||
{ | ||
"type": "Number", | ||
"name": 1 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "Declaration", | ||
"name": "flex", | ||
"vendor": "ms", | ||
"vendor": "webkit", | ||
"children": [ | ||
@@ -144,12 +176,2 @@ { | ||
"name": 1 | ||
}, | ||
{ | ||
"type": "Unit", | ||
"name": "%", | ||
"children": [ | ||
{ | ||
"type": "Number", | ||
"name": 0 | ||
} | ||
] | ||
} | ||
@@ -162,4 +184,4 @@ ] | ||
"type": "Declaration", | ||
"name": "box-flex", | ||
"vendor": "webkit", | ||
"name": "flex", | ||
"vendor": "ms", | ||
"children": [ | ||
@@ -172,2 +194,16 @@ { | ||
"name": 1 | ||
}, | ||
{ | ||
"type": "Number", | ||
"name": 1 | ||
}, | ||
{ | ||
"type": "Unit", | ||
"name": "%", | ||
"children": [ | ||
{ | ||
"type": "Number", | ||
"name": 0 | ||
} | ||
] | ||
} | ||
@@ -234,4 +270,20 @@ ] | ||
"type": "Declaration", | ||
"name": "box-flex", | ||
"vendor": "webkit", | ||
"children": [ | ||
{ | ||
"type": "Value", | ||
"children": [ | ||
{ | ||
"type": "Number", | ||
"name": 1 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "Declaration", | ||
"name": "flex", | ||
"vendor": "ms", | ||
"vendor": "webkit", | ||
"children": [ | ||
@@ -250,10 +302,4 @@ { | ||
{ | ||
"type": "Unit", | ||
"name": "%", | ||
"children": [ | ||
{ | ||
"type": "Number", | ||
"name": 0 | ||
} | ||
] | ||
"type": "Number", | ||
"name": 0 | ||
} | ||
@@ -266,4 +312,4 @@ ] | ||
"type": "Declaration", | ||
"name": "box-flex", | ||
"vendor": "webkit", | ||
"name": "flex", | ||
"vendor": "ms", | ||
"children": [ | ||
@@ -276,2 +322,16 @@ { | ||
"name": 1 | ||
}, | ||
{ | ||
"type": "Number", | ||
"name": 1 | ||
}, | ||
{ | ||
"type": "Unit", | ||
"name": "%", | ||
"children": [ | ||
{ | ||
"type": "Number", | ||
"name": 0 | ||
} | ||
] | ||
} | ||
@@ -338,4 +398,20 @@ ] | ||
"type": "Declaration", | ||
"name": "box-flex", | ||
"vendor": "webkit", | ||
"children": [ | ||
{ | ||
"type": "Value", | ||
"children": [ | ||
{ | ||
"type": "Number", | ||
"name": 1 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "Declaration", | ||
"name": "flex", | ||
"vendor": "ms", | ||
"vendor": "webkit", | ||
"children": [ | ||
@@ -369,4 +445,4 @@ { | ||
"type": "Declaration", | ||
"name": "box-flex", | ||
"vendor": "webkit", | ||
"name": "flex", | ||
"vendor": "ms", | ||
"children": [ | ||
@@ -379,2 +455,16 @@ { | ||
"name": 1 | ||
}, | ||
{ | ||
"type": "Number", | ||
"name": 1 | ||
}, | ||
{ | ||
"type": "Unit", | ||
"name": "px", | ||
"children": [ | ||
{ | ||
"type": "Number", | ||
"name": 0 | ||
} | ||
] | ||
} | ||
@@ -457,4 +547,4 @@ ] | ||
"type": "Declaration", | ||
"name": "flex", | ||
"vendor": "ms", | ||
"name": "box-flex", | ||
"vendor": "webkit", | ||
"children": [ | ||
@@ -465,10 +555,2 @@ { | ||
{ | ||
"type": "Number", | ||
"name": 1 | ||
}, | ||
{ | ||
"type": "Number", | ||
"name": 1 | ||
}, | ||
{ | ||
"type": "Keyword", | ||
@@ -484,3 +566,3 @@ "name": "auto", | ||
"type": "Declaration", | ||
"name": "box-flex", | ||
"name": "flex", | ||
"vendor": "webkit", | ||
@@ -503,2 +585,27 @@ "children": [ | ||
"name": "flex", | ||
"vendor": "ms", | ||
"children": [ | ||
{ | ||
"type": "Value", | ||
"children": [ | ||
{ | ||
"type": "Number", | ||
"name": 1 | ||
}, | ||
{ | ||
"type": "Number", | ||
"name": 1 | ||
}, | ||
{ | ||
"type": "Keyword", | ||
"name": "auto", | ||
"vendor": null | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "Declaration", | ||
"name": "flex", | ||
"vendor": null, | ||
@@ -560,4 +667,4 @@ "children": [ | ||
"type": "Declaration", | ||
"name": "flex", | ||
"vendor": "ms", | ||
"name": "box-flex", | ||
"vendor": "webkit", | ||
"children": [ | ||
@@ -568,12 +675,4 @@ { | ||
{ | ||
"type": "Number", | ||
"name": 0 | ||
}, | ||
{ | ||
"type": "Number", | ||
"name": 1 | ||
}, | ||
{ | ||
"type": "Keyword", | ||
"name": "auto", | ||
"name": "initial", | ||
"vendor": null | ||
@@ -587,3 +686,3 @@ } | ||
"type": "Declaration", | ||
"name": "box-flex", | ||
"name": "flex", | ||
"vendor": "webkit", | ||
@@ -606,2 +705,27 @@ "children": [ | ||
"name": "flex", | ||
"vendor": "ms", | ||
"children": [ | ||
{ | ||
"type": "Value", | ||
"children": [ | ||
{ | ||
"type": "Number", | ||
"name": 0 | ||
}, | ||
{ | ||
"type": "Number", | ||
"name": 1 | ||
}, | ||
{ | ||
"type": "Keyword", | ||
"name": "auto", | ||
"vendor": null | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "Declaration", | ||
"name": "flex", | ||
"vendor": null, | ||
@@ -608,0 +732,0 @@ "children": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
43885
1518
0
3