Files
less.js/lib/less/node/element.js
2010-03-01 19:47:32 -05:00

25 lines
755 B
JavaScript

if (typeof(window) === 'undefined') { var tree = require(require('path').join(__dirname, '..', '..', 'less', 'tree')); }
tree.Element = function Element(combinator, value) {
this.combinator = combinator;
this.value = value.trim();
};
tree.Element.prototype.toCSS = function () {
return this.combinator.toCSS() + this.value;
};
tree.Combinator = function Combinator(value) {
this.value = value ? value.trim() : "";
};
tree.Combinator.prototype.toCSS = function () {
switch (this.value) {
case '&' : return '';
case ':' : return ' :';
case '::': return '::';
case '+' : return ' + ';
case '~' : return ' ~ ';
case '>' : return ' > ';
default : return ' ' + this.value;
}
};