Sha256: 5ecfc068dcac0eb7501c620cd6121be964bb80dd453cd500e93e006d318cad9d
Contents?: true
Size: 1.43 KB
Versions: 33
Compression:
Stored size: 1.43 KB
Contents
/*! * Stylus - Keyframes * Copyright(c) 2010 LearnBoost <dev@learnboost.com> * MIT Licensed */ /** * Module dependencies. */ var Node = require('./node'); /** * Initialize a new `Keyframes` with the given `segs`, * and optional vendor `prefix`. * * @param {Array} segs * @param {String} prefix * @api public */ var Keyframes = module.exports = function Keyframes(segs, prefix){ Node.call(this); this.segments = segs; this.prefix = prefix || 'official'; }; /** * Inherit from `Node.prototype`. */ Keyframes.prototype.__proto__ = Node.prototype; /** * Return a clone of this node. * * @return {Node} * @api public */ Keyframes.prototype.clone = function(parent){ var clone = new Keyframes; clone.lineno = this.lineno; clone.filename = this.filename; clone.segments = this.segments.map(function(node) { return node.clone(parent, clone); }); clone.prefix = this.prefix; clone.block = this.block.clone(parent, clone); return clone; }; /** * Return a JSON representation of this node. * * @return {Object} * @api public */ Keyframes.prototype.toJSON = function(){ return { __type: 'Keyframes', segments: this.segments, prefix: this.prefix, block: this.block, lineno: this.lineno, filename: this.filename }; }; /** * Return `@keyframes name`. * * @return {String} * @api public */ Keyframes.prototype.toString = function(){ return '@keyframes ' + this.segments.join(''); };
Version data entries
33 entries across 19 versions & 1 rubygems