Sha256: 0f4e4f17d681a762591de73020372b92b8eae7253c046adb76bc214b68d7c419
Contents?: true
Size: 840 Bytes
Versions: 5
Compression:
Stored size: 840 Bytes
Contents
var Node = require("./node"); var Attribute = function (key, op, value) { this.key = key; this.op = op; this.value = value; }; Attribute.prototype = new Node(); Attribute.prototype.type = "Attribute"; Attribute.prototype.eval = function (context) { return new Attribute(this.key.eval ? this.key.eval(context) : this.key, this.op, (this.value && this.value.eval) ? this.value.eval(context) : this.value); }; Attribute.prototype.genCSS = function (context, output) { output.add(this.toCSS(context)); }; Attribute.prototype.toCSS = function (context) { var value = this.key.toCSS ? this.key.toCSS(context) : this.key; if (this.op) { value += this.op; value += (this.value.toCSS ? this.value.toCSS(context) : this.value); } return '[' + value + ']'; }; module.exports = Attribute;
Version data entries
5 entries across 5 versions & 2 rubygems