mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Fix trailing space when parent selector is the last part of the selector.
'''
.foo {
.bar & {
&:hover {
color: orange;
}
}
}
'''
now outputs
'''
.bar .foo:hover {
color: orange;
}
'''
This commit is contained in:
@@ -19,7 +19,12 @@ tree.Element.prototype.eval = function (env) {
|
||||
this.index);
|
||||
};
|
||||
tree.Element.prototype.toCSS = function (env) {
|
||||
return this.combinator.toCSS(env || {}) + (this.value.toCSS ? this.value.toCSS(env) : this.value);
|
||||
var value = (this.value.toCSS ? this.value.toCSS(env) : this.value);
|
||||
if (value == '' && this.combinator.value.charAt(0) == '&') {
|
||||
return '';
|
||||
} else {
|
||||
return this.combinator.toCSS(env || {}) + value;
|
||||
}
|
||||
};
|
||||
|
||||
tree.Combinator = function (value) {
|
||||
|
||||
Reference in New Issue
Block a user