Comparing version 0.12.0 to 0.12.1
{ | ||
"name": "rework", | ||
"version": "0.12.0", | ||
"version": "0.12.1", | ||
"description": "CSS manipulations built on CSSOM", | ||
@@ -5,0 +5,0 @@ "keywords": ["css", "manipulation", "preprocess", "transform"], |
0.12.1 / 2013-02-08 | ||
================== | ||
* fix mixins plugin traversal | ||
0.12.0 / 2013-01-16 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -15,6 +15,3 @@ | ||
return function(style, rework){ | ||
style.rules.forEach(function(rule){ | ||
if (!rule.declarations) return; | ||
visit(rule.declarations, mixins); | ||
}); | ||
rules(style.rules, mixins); | ||
} | ||
@@ -24,2 +21,17 @@ }; | ||
/** | ||
* Visit `rules`. | ||
* | ||
* @param {Array} rules | ||
* @param {Object} mixins | ||
* @api private | ||
*/ | ||
function rules(arr, mixins) { | ||
arr.forEach(function(rule){ | ||
if (rule.rules) rules(rule.rules, mixins); | ||
if (rule.declarations) visit(rule.declarations, mixins); | ||
}); | ||
} | ||
/** | ||
* Visit declarations and apply mixins. | ||
@@ -39,3 +51,3 @@ * | ||
if (!fn) continue; | ||
// invoke mixin | ||
@@ -51,6 +63,6 @@ var ret = fn(val); | ||
} | ||
// remove original | ||
declarations.splice(i, 1); | ||
} | ||
} | ||
} |
{ | ||
"name": "rework", | ||
"version": "0.12.0", | ||
"version": "0.12.1", | ||
"description": "CSS manipulations built on CSSOM", | ||
@@ -5,0 +5,0 @@ "keywords": ["css", "manipulation", "preprocess", "transform"], |
@@ -92,4 +92,4 @@ | ||
.toString(); | ||
console.log(str); | ||
Sorry, the diff of this file is not supported yet
42518
926