diff --git a/lib/less/node/ruleset.js b/lib/less/node/ruleset.js index 3a0b3a5c..a46fde0b 100644 --- a/lib/less/node/ruleset.js +++ b/lib/less/node/ruleset.js @@ -16,21 +16,17 @@ node.Ruleset.prototype = { env.frames.unshift(this); for (var i = 0; i < this.rules.length; i++) { - if (this.rules[i] instanceof node.Ruleset) { continue } - - if (this.rules[i].toCSS) { - rules.push(this.rules[i].toCSS(env)); + if (this.rules[i] instanceof node.Ruleset) { + rulesets.push(this.rules[i].toCSS(path, env)); } else { - if (this.rules[i].value) { + if (this.rules[i].toCSS) { + rules.push(this.rules[i].toCSS(env)); + } else if (this.rules[i].value) { rules.push(this.rules[i].value.toString()); } } } - for (var i = 0; i < this.rules.length; i++) { - if (! (this.rules[i] instanceof node.Ruleset)) { continue } - rulesets.push(this.rules[i].toCSS(path, env)); - } if (rules.length > 0) { if (path.length > 0) { css.push(path.join('').trim(),