Combinarea părților selectorului în LESS
Puteți combina chiar și părți ale unei singure clase. De exemplu, astfel:
styles.less.button {
&-ok {
color: green;
}
&-cancel {
color: red;
}
}
Ca rezultat, după compilare vom obține următorul cod:
styles.css.button-ok {
color: green;
}
.button-cancel {
color: red;
}
Задание 1
Simplificați codul dat:
styles.less.label-success {
color: green;
}
.label-warning {
color: yellow;
}
.label-error {
color: red;
}