LESS'te Seçici Parçalarını Birleştirme
Hatta bir sınıfın parçalarını bile birleştirebilirsiniz. Örneğin, şu şekilde:
.button {
&-ok {
color: green;
}
&-cancel {
color: red;
}
}
Derleme sonucunda aşağıdaki kod elde edilecektir:
.button-ok {
color: green;
}
.button-cancel {
color: red;
}
Aşağıdaki kodu basitleştirin:
.label-success {
color: green;
}
.label-warning {
color: yellow;
}
.label-error {
color: red;
}