Menghubungkan Bagian Selektor di LESS
Anda bahkan dapat menghubungkan bagian dari satu kelas. Contohnya, seperti ini:
.button {
&-ok {
color: green;
}
&-cancel {
color: red;
}
}
Hasilnya, setelah kompilasi kita akan mendapatkan kode berikut:
.button-ok {
color: green;
}
.button-cancel {
color: red;
}
Sederhanakan kode yang diberikan:
.label-success {
color: green;
}
.label-warning {
color: yellow;
}
.label-error {
color: red;
}