UNPKG

stylus

Version:

Robust, expressive, and feature-rich CSS superset

62 lines (48 loc) 805 B
/*! * Stylus - Root * Copyright(c) 2010 LearnBoost <dev@learnboost.com> * MIT Licensed */ /** * Module dependencies. */ var Node = require('./node'); /** * Initialize a new `Root` node. * * @api public */ var Root = module.exports = function Root(){ this.nodes = []; }; /** * Inherit from `Node.prototype`. */ Root.prototype.__proto__ = Node.prototype; /** * Push a `node` to this block. * * @param {Node} node * @api public */ Root.prototype.push = function(node){ this.nodes.push(node); }; /** * Unshift a `node` to this block. * * @param {Node} node * @api public */ Root.prototype.unshift = function(node){ this.nodes.unshift(node); }; /** * Return "root". * * @return {String} * @api public */ Root.prototype.toString = function(){ return '[Root]'; };