mirror of
https://github.com/less/less.js.git
synced 2026-02-02 11:05:10 -05:00
23 lines
551 B
JavaScript
23 lines
551 B
JavaScript
(function (tree) {
|
|
|
|
tree.Negative = function (node) {
|
|
this.value = node;
|
|
};
|
|
tree.Negative.prototype = {
|
|
type: "Negative",
|
|
accept: function (visitor) {
|
|
this.value = visitor.visit(this.value);
|
|
},
|
|
toCSS: function (env) {
|
|
return '-' + this.value.toCSS(env);
|
|
},
|
|
eval: function (env) {
|
|
if (env.isMathOn()) {
|
|
return (new(tree.Operation)('*', [new(tree.Dimension)(-1), this.value])).eval(env);
|
|
}
|
|
return new(tree.Negative)(this.value.eval(env));
|
|
}
|
|
};
|
|
|
|
})(require('../tree'));
|