Namespaces in LESS
It may be that you have two different mixins with the same name, but located in different blocks:
#block1 {
.button {
border: 1px solid black;
}
}
#block2 {
.button {
width: 100px;
}
}
In this case, these mixins are said to belong to different namespaces. To use such a mixin, in addition to its name, you also need to specify the parent block selector.
Let's use the first mixin:
.test {
#block1 > .button;
}
And now the second one:
.test {
#block2 > .button;
}
Tell me what the result of compiling the following code will be:
#block1 {
.mix {
width: 100px;
}
}
#block2 {
.mix {
height: 200px;
}
}
.test {
#block1 > .mix;
#block2 > .mix;
}