Sha256: c9f9e83835fe323311545c329a8ef10dc7d52d40391458b20fe0a723ad827e07

Contents?: true

Size: 1.14 KB

Versions: 9

Compression:

Stored size: 1.14 KB

Contents

(function (tree) {

tree.Rule = function (name, value, important, index, inline) {
    this.name = name;
    this.value = (value instanceof tree.Value) ? value : new(tree.Value)([value]);
    this.important = important ? ' ' + important.trim() : '';
    this.index = index;
    this.inline = inline || false;

    if (name.charAt(0) === '@') {
        this.variable = true;
    } else { this.variable = false }
};
tree.Rule.prototype.toCSS = function (env) {
    if (this.variable) { return "" }
    else {
        return this.name + (env.compress ? ':' : ': ') +
               this.value.toCSS(env) +
               this.important + (this.inline ? "" : ";");
    }
};

tree.Rule.prototype.eval = function (context) {
    return new(tree.Rule)(this.name,
                          this.value.eval(context),
                          this.important,
                          this.index, this.inline);
};

tree.Shorthand = function (a, b) {
    this.a = a;
    this.b = b;
};

tree.Shorthand.prototype = {
    toCSS: function (env) {
        return this.a.toCSS(env) + "/" + this.b.toCSS(env);
    },
    eval: function () { return this }
};

})(require('../tree'));

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
less-2.3.0 lib/less/js/lib/less/tree/rule.js
less-2.2.2 lib/less/js/lib/less/tree/rule.js
less-2.2.1 lib/less/js/lib/less/tree/rule.js
less-2.2.0 lib/less/js/lib/less/tree/rule.js
less-2.1.0 lib/less/js/lib/less/tree/rule.js
less-2.0.12 lib/less/js/lib/less/tree/rule.js
less-2.0.11 lib/less/js/lib/less/tree/rule.js
less-2.0.10 lib/less/js/lib/less/tree/rule.js
less-2.0.9 lib/less/js/lib/less/tree/rule.js