postcss-mixins
Advanced tools
Comparing version 0.4.0 to 1.0.0
@@ -0,1 +1,4 @@ | ||
## 1.0 | ||
* Use PostCSS 5.0 API. | ||
## 0.4 | ||
@@ -2,0 +5,0 @@ * Add `mixinsFiles` option (by Jed Mao). |
21
index.js
@@ -65,5 +65,6 @@ var postcss = require('postcss'); | ||
} else if ( mixin.name === 'define-mixin' ) { | ||
var i; | ||
var values = { }; | ||
for ( var i = 0; i < meta.args.length; i++ ) { | ||
values[ meta.args[i][0] ] = params[i] || meta.args[i][1]; | ||
for ( i = 0; i < meta.args.length; i++ ) { | ||
values[meta.args[i][0]] = params[i] || meta.args[i][1]; | ||
} | ||
@@ -81,3 +82,3 @@ | ||
if ( meta.content ) { | ||
proxy.eachAtRule('mixin-content', function (place) { | ||
proxy.walkAtRules('mixin-content', function (place) { | ||
place.replaceWith(rule.nodes); | ||
@@ -100,3 +101,3 @@ }); | ||
if ( rule.parent ) rule.removeSelf(); | ||
if ( rule.parent ) rule.remove(); | ||
}; | ||
@@ -121,3 +122,3 @@ | ||
} else { | ||
args = postcss.list.comma(other).map(function(str) { | ||
args = postcss.list.comma(other).map(function (str) { | ||
var arg = str.split(':', 1)[0]; | ||
@@ -131,3 +132,3 @@ var defaults = str.slice(arg.length + 1); | ||
var content = false; | ||
rule.eachAtRule('mixin-content', function () { | ||
rule.walkAtRules('mixin-content', function () { | ||
content = true; | ||
@@ -138,3 +139,3 @@ return false; | ||
mixins[name] = { mixin: rule, args: args, content: content }; | ||
rule.removeSelf(); | ||
rule.remove(); | ||
}; | ||
@@ -169,4 +170,4 @@ | ||
globs.forEach(function(pattern) { | ||
glob.sync(pattern).forEach(function(file2) { | ||
globs.forEach(function (pattern) { | ||
glob.sync(pattern).forEach(function (file2) { | ||
var name2 = path.basename(file2, path.extname(file2)); | ||
@@ -183,3 +184,3 @@ mixins[name2] = { mixin: require(file2) }; | ||
return function (css, result) { | ||
css.eachAtRule(function (rule) { | ||
css.walkAtRules(function (rule) { | ||
@@ -186,0 +187,0 @@ if ( rule.name === 'mixin' ) { |
{ | ||
"name": "postcss-mixins", | ||
"version": "0.4.0", | ||
"description": "PostCSS plugin for mixins", | ||
"keywords": ["postcss", "css", "postcss-plugin", "mixins", "sass"], | ||
"author": "Andrey Sitnik <andrey@sitnik.ru>", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/postcss/postcss-mixins.git" | ||
}, | ||
"dependencies": { | ||
"postcss-simple-vars": "^0.3.0", | ||
"postcss": "^4.1.16", | ||
"glob": "^5.0.14" | ||
}, | ||
"devDependencies": { | ||
"gulp-eslint": "0.15.0", | ||
"gulp-mocha": "2.1.3", | ||
"mocha": "2.2.5", | ||
"chai": "3.1.0", | ||
"gulp": "3.9.0" | ||
}, | ||
"scripts": { | ||
"test": "gulp" | ||
} | ||
"name": "postcss-mixins", | ||
"version": "1.0.0", | ||
"description": "PostCSS plugin for mixins", | ||
"keywords": [ | ||
"postcss", | ||
"css", | ||
"postcss-plugin", | ||
"mixins", | ||
"sass" | ||
], | ||
"author": "Andrey Sitnik <andrey@sitnik.ru>", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/postcss/postcss-mixins.git" | ||
}, | ||
"dependencies": { | ||
"postcss-simple-vars": "^1.0.0", | ||
"postcss": "^5.0.2", | ||
"glob": "^5.0.14" | ||
}, | ||
"devDependencies": { | ||
"gulp-eslint": "1.0.0", | ||
"gulp-mocha": "2.1.3", | ||
"mocha": "2.2.5", | ||
"chai": "3.2.0", | ||
"gulp": "3.9.0" | ||
}, | ||
"scripts": { | ||
"test": "gulp" | ||
} | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
18180
159
1
+ Addedansi-regex@2.1.1(transitive)
+ Addedansi-styles@2.2.1(transitive)
+ Addedchalk@1.1.3(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedhas-ansi@2.0.0(transitive)
+ Addedhas-flag@1.0.0(transitive)
+ Addedjs-base64@2.6.4(transitive)
+ Addedpostcss@5.2.18(transitive)
+ Addedpostcss-simple-vars@1.2.0(transitive)
+ Addedsource-map@0.5.7(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedsupports-color@2.0.03.2.3(transitive)
- Removedamdefine@1.0.1(transitive)
- Removedes6-promise@2.3.0(transitive)
- Removedjs-base64@2.1.9(transitive)
- Removedpostcss@4.1.16(transitive)
- Removedpostcss-simple-vars@0.3.0(transitive)
- Removedsource-map@0.4.4(transitive)
Updatedpostcss@^5.0.2
Updatedpostcss-simple-vars@^1.0.0