You can't use when
in the way you are trying to, it always has to appear after in the mixin-declaration. And you have to provide a fallback mixin, if the variable does not match the guard.
.my-mixing (@isInverse) {
.navbar {
.navbar-inverse(@isInverse);
}
}
.navbar-inverse(@a) when(@a){
/* do something if it matches */
}
.navbar-inverse(@a) when not(@a){
/* do something else (or nothing at all) */
}
.my-mixing(true);
I added when not(@a)
in the second mixin, so it won't get included per se. You could as well place it before the guarded mixin to prevent styles from being overridden.