I am fairly new Less and have been trying to get a jQuery plugin to work with my custom CSS generated via Less. Basically, what I have is the following html generated by a plugin:
<div class="classA class B" ....>
<div class="classC classD" ....>
<div class="classE classF" ....>
..........
I am not sure how to structure my Less file in order to generate CSS that matches the above.
I have tried:
.classA {
......
&.classB {
.....
&.classC {
....and so on
but it generates the following CSS:
.classA {...}
.classA.classB {....} /*This does not include the CSS of classA */
.classA.classB.classC {.....} /*This does not include CSS of classA or classB*/
...
The plain CSS is fairly easy to write :
.classA {.....}
.classB {.....}
and when I write how do I achieve the above using Less? Is there a simple way to achieve this without using functions or extends?
&does in less. If you want the output to be.classA {.....} .classB {.....}don't use&. The "plain CSS" will work in less.