LESS mixin calling another mixin
-
27-04-2021 - |
Pregunta
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();
}
Solución
I got it to work by adding this:
#test {
.mix() {
border: 1px solid #000000;
}
.mix2() {
#test .mix();
}
}
h1 {
#test > .mix2();
}
Otros consejos
Try:
#test {
...
.mix2() {
.mix;
}
}
h1 {
#test > .mix2;
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow