Say - have a .less sheet with a large number of "multiple" css rules to manage iconography. Something like so:
.icon { display:inline-block; position:relative; text-indent:-9999em;}
.icon-l.legend { width:24px; height:24px;}
.icon-white.legend{ background:url(@icon_legend_white) no-repeat;}
.icon-l.arrow_left{background-position: -128px -32px;}
and apply rules like this as such:
<i class="icon icon-l icon-color legend arrow_left"></i>
This works fine when I have access to markup, as one would expect, but I'm having a hard time applying these rules via less to a given element:
Here's what i would expect to work:
#something{
.icon;
.icon-l.legend;
.icon-white.legend;
.icon-l.arrow_left;
}
Which just throws an error.
I'm "led to believe" that the "&" operator can apply rules like so:
#something{
.icon;
.icon-l{&.legend{}};
.icon-white{&.legend{}};
.icon-l{&.arrow_left{}};
}
This throws no error, but only the rules for .icon are getting applied.
Anyone have a solution?
UPDATE
FYI - I'm compiling several .less files together for many different unique sheets. Works really well.
SublimeText2 plugin - works reasonably well, and integrates really well into the workflow (need to 'build' the file) - but could not render multiple classes like this
SimpLess - is a nice standalone that I like alot, except that I kept getting errors compiling my less stack - without clear reference to the error location
WinLess - manages to complete all my compiling needs, as well as successfully compiling multiple classes like this. Also - its error reporting is very specific. Making it the winner.