LESS mixin calling another mixin
-
29-04-2021 - |
Question
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();
}
Solution
I got it to work by adding this:
#test {
.mix() {
border: 1px solid #000000;
}
.mix2() {
#test .mix();
}
}
h1 {
#test > .mix2();
}
OTHER TIPS
Try:
#test {
...
.mix2() {
.mix;
}
}
h1 {
#test > .mix2;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow