leafo/lessphp — Issue #184: Nested Parametric Mixin fail
Author: selfsimilar
Created: 2012-02-08 22:07:22+00:00
State: open

The following code:
```@bg-color1:black;
@text-color1:white;
@bg-color2:blue;
@text-color2:yellow;
.color-settings(@bgcolor: gray, @tcolor: white) {
.content .field, .node-challenge {
.field-label {
background-color:@bgcolor;
color:@tcolor;
&+.field, &+.field-items {
border-color: @bgcolor;
}
}
}
}
#example1 {
.color-settings(@bg-color1, @text-color1);
}
#example2 {
.color-settings(@bg-color2, @text-color2);
}
```

will output the following broken css using lessphp v0.3.1:

```.color-settings(@bgcolor: gray .content .field .field-label, .color-settings(@bgcolor: gray .node-challenge .field-label, $tcolor: white) .content .field .field-label, $tcolor: white) .node-challenge .field-label {
background-color:;
color:;
}
.color-settings(@bgcolor: gray .content .field .field-label+.field, .color-settings(@bgcolor: gray .content .field .field-label+.field-items, .color-settings(@bgcolor: gray .node-challenge .field-label+.field, .color-settings(@bgcolor: gray .node-challenge .field-label+.field-items, $tcolor: white) .content .field .field-label+.field, $tcolor: white) .content .field .field-label+.field-items, $tcolor: white) .node-challenge .field-label+.field, $tcolor: white) .node-challenge .field-label+.field-items { border-color:; }
```

Expected output:
```#example1 .content .field .field-label, #example1 .node-challenge .field-label {
background-color: #000000;
color: #ffffff;
}
#example1 .content .field .field-label + .field,
#example1 .node-challenge .field-label + .field,
#example1 .content .field .field-label + .field-items,
#example1 .node-challenge .field-label + .field-items {
border-color: #000000;
}
#example2 .content .field .field-label, #example2 .node-challenge .field-label {
background-color: #0000ff;
color: #ffff00;
}
#example2 .content .field .field-label + .field,
#example2 .node-challenge .field-label + .field,
#example2 .content .field .field-label + .field-items,
#example2 .node-challenge .field-label + .field-items {
border-color: #0000ff;
}
```