mirror of
https://github.com/less/less.js.git
synced 2026-02-08 22:15:04 -05:00
22 lines
572 B
JavaScript
22 lines
572 B
JavaScript
var Node = require("./node.js");
|
|
|
|
var Combinator = function (value) {
|
|
if (value === ' ') {
|
|
this.value = ' ';
|
|
} else {
|
|
this.value = value ? value.trim() : "";
|
|
}
|
|
};
|
|
Combinator.prototype = new Node();
|
|
Combinator.prototype.type = "Combinator";
|
|
var _noSpaceCombinators = {
|
|
'': true,
|
|
' ': true,
|
|
'|': true
|
|
};
|
|
Combinator.prototype.genCSS = function (env, output) {
|
|
var spaceOrEmpty = (env.compress || _noSpaceCombinators[this.value]) ? '' : ' ';
|
|
output.add(spaceOrEmpty + this.value + spaceOrEmpty);
|
|
};
|
|
module.exports = Combinator;
|