support for nested rulesets inside dynamic mixins, with lexical scoping

browser
cloudhead 15 years ago
parent 01dac20cd8
commit be893c5993

@ -45,7 +45,13 @@ tree.mixin.Definition.prototype = {
context = { frames: [this, frame].concat(env.frames) };
return new(tree.Ruleset)(null, this.rules.map(function (rule) {
if (rule.rules) {
return new(tree.Ruleset)(rule.selectors, rule.rules.map(function (r) {
return new(tree.Rule)(r.name, r.value.eval(context));
}));
} else {
return new(tree.Rule)(rule.name, rule.value.eval(context));
}
}));
}
};

@ -33,3 +33,9 @@ body {
.scope-mix {
width: 8;
}
.content {
width: 600px;
}
.content .column {
margin: 600px;
}

@ -62,3 +62,11 @@ body {
.scope-mix {
.global-mixin(3);
}
.nested-ruleset (@width: 200px) {
width: @width;
.column { margin: @width; }
}
.content {
.nested-ruleset(600px);
}

Loading…
Cancel
Save