LESS mixin calling another mixin
-
29-04-2021 - |
Domanda
I am using lessphp (latest from git)
Is it possible to call a mixin from another mixin in the same "namespace"?
Here is a short sample of code which produces no output (but should give a border to h1)
#test {
.mix() {
border: 1px solid #000000;
}
.mix2() {
.mix();
}
}
h1 {
#test > .mix2();
}
Soluzione
I got it to work by adding this:
#test {
.mix() {
border: 1px solid #000000;
}
.mix2() {
#test .mix();
}
}
h1 {
#test > .mix2();
}
Altri suggerimenti
Try:
#test {
...
.mix2() {
.mix;
}
}
h1 {
#test > .mix2;
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow