1.0.1 • Published 9 years ago

less-features v1.0.1

Weekly downloads
3
License
BSD-2-Clause
Repository
github
Last release
9 years ago

LESS custom conditions

Plugin for create special conditions for mixin guards

##Usage

Init

var Features = require("less-features");
    list = {
        "feature": {
            "state": true
        },
        "another-feature": {
            "state": false
        },
        "one-more-feature": true
    };

less.render(lessString, {plugins: [new Features(list)]}, function(err, result) {/* */});

Call in LESS

.guarded-mixin() when (feature("feature")) {
    .class {
        color: red;
    }
}
.guarded-mixin() when (feature("another-feature")) {
    .another-class {
        color: green;
    }
}
.guarded-mixin() when (feature("one-more-feature")) {
    .one-more-class {
        color: blue;
    }
}
.guarded-mixin();

Compiled CSS

.class {
    color: red;
}
.one-more-class {
    color: blue;
}