Files
less.js/lib/less/tree/combinator.js
2014-10-11 18:51:09 +01:00

24 lines
668 B
JavaScript

var Node = require("./node");
var Combinator = function (value) {
if (value === ' ') {
this.value = ' ';
this.emptyOrWhitespace = true;
} else {
this.value = value ? value.trim() : "";
this.emptyOrWhitespace = this.value === "";
}
};
Combinator.prototype = new Node();
Combinator.prototype.type = "Combinator";
var _noSpaceCombinators = {
'': true,
' ': true,
'|': true
};
Combinator.prototype.genCSS = function (context, output) {
var spaceOrEmpty = (context.compress || _noSpaceCombinators[this.value]) ? '' : ' ';
output.add(spaceOrEmpty + this.value + spaceOrEmpty);
};
module.exports = Combinator;