cloudhead/less.js — pull request #705 by souldreamer (2012-03-12 11:21:25+00:00)
Title: Better & combinator

Basic fix for #639 and #704.

It has problems with (double) spacing: ```a { div > &``` becomes ```div a```, ```a { & > div``` becomes ```a > div``` and ```a { div > & + b``` becomes ```div > a + b```. Doesn't handle more than one & in the same rule (ignores all &'s other than the first one).

```less
a {
div > & {
background-color: red;
}
& div { color: red; }
& > div { color: red; }
& > div + div { color: blue; }
input & output { color: silver; }
div > & + b {
color: white;
}
}
```

compiles to:

```css
div > a {
background-color: red;
}
a div {
color: red;
}
a > div {
color: red;
}
a > div + div {
color: blue;
}
input a output {
color: silver;
}
div > a + b {
color: white;
}
```