mirror of
https://github.com/less/less.js.git
synced 2026-01-24 06:38:05 -05:00
25 lines
755 B
JavaScript
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;
|
|
}
|
|
};
|