Sha256: 5c8990bcea54296edb4b1a726c72b88b1cdb1a6bfda7e3f6a9810301ded89078
Contents?: true
Size: 610 Bytes
Versions: 5
Compression:
Stored size: 610 Bytes
Contents
var Node = require("./node"), Operation = require("./operation"), Dimension = require("./dimension"); var Negative = function (node) { this.value = node; }; Negative.prototype = new Node(); Negative.prototype.type = "Negative"; Negative.prototype.genCSS = function (context, output) { output.add('-'); this.value.genCSS(context, output); }; Negative.prototype.eval = function (context) { if (context.isMathOn()) { return (new Operation('*', [new Dimension(-1), this.value])).eval(context); } return new Negative(this.value.eval(context)); }; module.exports = Negative;
Version data entries
5 entries across 5 versions & 2 rubygems