Comparing version 0.5.0 to 0.5.1
{ | ||
"name": "rework", | ||
"version": "0.4.1", | ||
"version": "0.5.1", | ||
"description": "CSS manipulations built on CSSOM", | ||
@@ -5,0 +5,0 @@ "keywords": ["css", "manipulation", "preprocess", "transform"], |
0.5.1 / 2012-09-18 | ||
================== | ||
* add visiting of `@media` nodes for `url()` | ||
* add `/g` flag to `url()` | ||
0.5.0 / 2012-09-17 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -25,5 +25,3 @@ | ||
return function(style, rework){ | ||
style.rules.forEach(function(rule){ | ||
if (rule.declarations) url(rule, fn); | ||
}); | ||
rules(style.rules, fn); | ||
} | ||
@@ -33,2 +31,17 @@ }; | ||
/** | ||
* Visit `rules`. | ||
* | ||
* @param {Array} rules | ||
* @param {Function} fn | ||
* @api private | ||
*/ | ||
function rules(arr, fn) { | ||
arr.forEach(function(rule){ | ||
if (rule.rules) rules(rule.rules, fn); | ||
if (rule.declarations) url(rule, fn); | ||
}); | ||
} | ||
/** | ||
* Map url(). | ||
@@ -42,3 +55,3 @@ * | ||
if (!~decl.value.indexOf('url(')) return decl; | ||
decl.value = decl.value.replace(/url\(([^)]+)\)/, function(_, url){ | ||
decl.value = decl.value.replace(/url\(([^)]+)\)/g, function(_, url){ | ||
url = utils.stripQuotes(url); | ||
@@ -45,0 +58,0 @@ return 'url("' + fn(url) + '")'; |
{ | ||
"name": "rework", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "CSS manipulations built on CSSOM", | ||
@@ -5,0 +5,0 @@ "keywords": ["css", "manipulation", "preprocess", "transform"], |
23297
463