Sha256: a913f1317ba3f4ab2a7806a532400b0aed8da97873e15c1e5042aeeff532e5a2

Contents?: true

Size: 1.29 KB

Versions: 18

Compression:

Stored size: 1.29 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 `name`,
 * and optional vendor `prefix`.
 *
 * @param {String} name
 * @param {String} prefix
 * @api public
 */

var Keyframes = module.exports = function Keyframes(name, prefix){
  Node.call(this);
  this.name = name;
  this.frames = [];
  this.prefix = prefix || 'official';
};

/**
 * Inherit from `Node.prototype`.
 */

Keyframes.prototype.__proto__ = Node.prototype;

/**
 * Push the given `block` at `pos`.
 *
 * @param {Unit} pos
 * @param {Block} block
 * @api public
 */

Keyframes.prototype.push = function(pos, block){
  this.frames.push({
      pos: pos
    , block: block
  });
};

/**
 * Return a clone of this node.
 * 
 * @return {Node}
 * @api public
 */

Keyframes.prototype.clone = function(){
  var clone = new Keyframes(this.name);
  clone.lineno = this.lineno;
  clone.prefix = this.prefix;
  clone.frames = this.frames.map(function(node){
    node.block = node.block.clone();
    return node;
  });
  return clone;
};

/**
 * Return `@keyframes name`.
 *
 * @return {String}
 * @api public
 */

Keyframes.prototype.toString = function(){
  return '@keyframes ' + this.name;
};

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
stylus-source-0.22.0 vendor/lib/nodes/keyframes.js
stylus-source-0.21.2 vendor/lib/nodes/keyframes.js
stylus-source-0.21.1 vendor/lib/nodes/keyframes.js
stylus-source-0.21.0 vendor/lib/nodes/keyframes.js
stylus-source-0.20.1 vendor/lib/nodes/keyframes.js
stylus-source-0.20.0 vendor/lib/nodes/keyframes.js
stylus-source-0.19.8 vendor/lib/nodes/keyframes.js
stylus-source-0.19.7 vendor/lib/nodes/keyframes.js
stylus-source-0.19.6 vendor/lib/nodes/keyframes.js
stylus-source-0.19.5 vendor/lib/nodes/keyframes.js
stylus-source-0.19.4 vendor/lib/nodes/keyframes.js
stylus-source-0.19.3 vendor/lib/nodes/keyframes.js
stylus-source-0.19.2 vendor/lib/nodes/keyframes.js
stylus-source-0.19.1 vendor/lib/nodes/keyframes.js
stylus-source-0.19.0 vendor/lib/nodes/keyframes.js
stylus-source-0.18.0 vendor/lib/nodes/keyframes.js
stylus-source-0.17.0 vendor/lib/nodes/keyframes.js
stylus-source-0.15.4 lib/stylus/nodes/keyframes.js