LESS'te Sözde Sınıfları Birleştirme
Ampersand, sözde sınıflarla çalışırken kullanımı uygundur. Örneğe bakın:
a {
color: blue;
&:hover {
color: red;
}
}
Derleme sonucu:
a {
color: blue;
}
a:hover {
color: red;
}
Aşağıdaki kodun derleme sonucu ne olur, anlatın:
a.class {
&:link {
color: red;
}
&:visited {
color: blue;
}
&:hover {
color: green;
}
}
Verilen kodu basitleştirin:
#block {
width: 300px;
}
#block a:link, #block a:visited {
color: red;
}
#block a:hover {
color: blue;
}