mirror of
https://github.com/less/less.js.git
synced 2026-01-22 13:48:03 -05:00
24 lines
668 B
JavaScript
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;
|