mirror of
https://github.com/less/less.js.git
synced 2026-02-06 13:05:07 -05:00
19 lines
442 B
JavaScript
19 lines
442 B
JavaScript
(function (tree) {
|
|
|
|
tree.Negative = function (node) {
|
|
this.value = node;
|
|
};
|
|
tree.Negative.prototype = {
|
|
toCSS: function (env) {
|
|
return '-' + this.value.toCSS(env);
|
|
},
|
|
eval: function (env) {
|
|
if (env.isMathsOn()) {
|
|
return (new(tree.Operation)('*', [new(tree.Dimension)(-1), this.value])).eval(env);
|
|
}
|
|
return new(tree.Negative)(this.value.eval(env));
|
|
}
|
|
};
|
|
|
|
})(require('../tree'));
|