postcss-variables
Advanced tools
Comparing version 0.2.1 to 1.0.0
14
index.js
@@ -156,12 +156,8 @@ const postcss = require('postcss'); | ||
function eachMixin(node, parent, nodeCount) { | ||
node.arguments = node.arguments.map(arg => { | ||
if (typeof arg === 'object') { | ||
Object.keys(arg).forEach(key => { | ||
arg[key] = getVariableTransformedString(parent, arg[key]); | ||
}); | ||
} else { | ||
arg = getVariableTransformedString(parent, arg); | ||
} | ||
node.arguments.ordered = node.arguments.ordered.map(arg => { | ||
return getVariableTransformedString(parent, arg); | ||
}); | ||
return arg; | ||
Object.keys(node.arguments.named).forEach(arg => { | ||
node.arguments.named[arg] = getVariableTransformedString(parent, node.arguments.named[arg]); | ||
}); | ||
@@ -168,0 +164,0 @@ |
{ | ||
"name": "postcss-variables", | ||
"version": "0.2.1", | ||
"version": "1.0.0", | ||
"description": "PostCSS plugin that converts variables into CSS", | ||
@@ -16,2 +16,3 @@ "main": "index.js", | ||
}, | ||
"repository": "nathanhood/postcss-variables", | ||
"author": "Nathan Hood", | ||
@@ -26,5 +27,5 @@ "license": "MIT", | ||
"mocha": "^3.2.0", | ||
"postcss-js-mixins": "^0.2", | ||
"postcss-wee-syntax": "^1.1.1" | ||
"postcss-js-mixins": "^2.0.1", | ||
"postcss-wee-syntax": "2.0.0" | ||
} | ||
} |
@@ -5,2 +5,3 @@ # PostCSS Variables | ||
[![codecov](https://codecov.io/gh/nathanhood/postcss-variables/branch/master/graph/badge.svg)](https://codecov.io/gh/nathanhood/postcss-variables) | ||
[![npm version](https://badge.fury.io/js/postcss-variables.svg)](https://badge.fury.io/js/postcss-variables) | ||
@@ -164,4 +165,2 @@ <img align="right" width="135" height="95" src="http://postcss.github.io/postcss/logo-leftp.png" title="Philosopher’s stone, logo of PostCSS"> | ||
module.exports = register(vars); | ||
``` | ||
**Note:** Please refer to [Advanced Variables](https://github.com/jonathantneal/postcss-advanced-variables) for more advanced features. This library is essentially a simplification and alteration of that plugin. Thank you to the author for making it available. | ||
``` |
12
tests.js
@@ -338,2 +338,14 @@ const expect = require('chai').expect; | ||
}); | ||
it('should resolve key: value params passed into mixin', () => { | ||
return processMixins( | ||
`$color: #000; | ||
.block { | ||
mixin(color: $color, 10, 30px); | ||
}`, | ||
`.block { | ||
mixin(10, 30px, color: #000); | ||
}` | ||
); | ||
}); | ||
}); | ||
@@ -340,0 +352,0 @@ |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
19255
627
1
164