Answer the question
In order to leave comments, you need to log in
Is it possible in Less to extend the beginning of the class name to child elements?
Good afternoon, there is such a code, the presence of a wrapper is required.
.wrapper {
.less {
&-level-1 &-level-2 {
color: red;
}
}
}
Answer the question
In order to leave comments, you need to log in
If you need to end up with the selector `.less-level-1 .less-level-2 { ... }` then the only option is:
.less {
&-level-1 {
display: block;
}
&-level-1 &-level-2 {
display: block;
}
}
The documentation has comprehensive examples. It's good to look into it sometimes.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question