LESS-da selektor qismlarini birlashtirish
Hatto bir sinfning qismlarini ham birlashtirish mumkin. Masan, shunday:
.button {
&-ok {
color: green;
}
&-cancel {
color: red;
}
}
Natijada, kompilyatsiyadan so'ng bizga quyidagi kod hosil bo'ladi:
.button-ok {
color: green;
}
.button-cancel {
color: red;
}
Keltirilgan kodni soddalashtiring:
.label-success {
color: green;
}
.label-warning {
color: yellow;
}
.label-error {
color: red;
}