Spájanie častí selektora v LESS
Je možné spájať aj časti jednej triedy. Napríklad takto:
.button {
&-ok {
color: green;
}
&-cancel {
color: red;
}
}
Výsledkom po kompilácii bude nasledujúci kód:
.button-ok {
color: green;
}
.button-cancel {
color: red;
}
Zjednodušte uvedený kód:
.label-success {
color: green;
}
.label-warning {
color: yellow;
}
.label-error {
color: red;
}