I'm using a dotLess 'mixin' like this:
.base-button-style
{
...
}
.specific-button-style
{
.base-button-style; //mixin
...
}
This works fine. But now I need to change the selector of the base style to give it a higher precedence by adding the tag name:
input.base-button-style
{
...
}
However, dotLess doesn't seem to like this, so the .less file can't be "parsed" at all. I've tried changing it to this with no better result:
input.base-button-style
{
...
}
.specific-button-style
{
input.base-button-style;
...
}
(That is, having the tag name in both the base style and where it is used as a mixin.)
Is there a way to make this work?
Note that I use both base-button-style and specific-button-style in my HTML.
I'm not sure if the mixins can have selectors, as they are effectively functions that are stripped out of the final code.
It might be better to nest your
.specific-button-styleunder the.base-button-stylelike this:The &: operator for the
.editand.orangeclasses effectively produces.button.editand.button.orangeclasses. The HTML element thus hasclass='button edit'. That will work on IE7+, and all the usual others.