Skip to content

Nested rules inside mixins #12

@jamesfoster

Description

@jamesfoster

Not sure if this is an intentional restriction but the following doesn't seem to work

.mixin() {
    a {
        color: red;
        span { color: blue; }
    }
}
.class { .mixin; }

should output

.class a {
    color: red;
}
.class a span {
    color: blue;
}

it only works with one level of nesting, the second level is lost when you run this code in mixin.js:

return new(tree.Ruleset)(rule.selectors, rule.rules.map(function (r) {
    return new(tree.Rule)(r.name, r.value.eval(context));
}));

You could also change this area of code to allow a mixin.Call or even a mixin.Definition inside another mixin.Definition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions