Answer the question
In order to leave comments, you need to log in
How to code properly with LESS, BEM and &?
I have the following code in LESS
.sf-btn {
&_size_s{
.btn-size(.75)
}
&_square{
.btn-square(1);
&_size_s{
.btn-square(.75)
}
}
}
.sf-btn_size_s{}
.sf-btn_square.sf-btn_size_s{}
.sf-btn_size_s{}
.sf-btn_square_size_s{}
.sf-btn {
&_size_s{
.btn-size(.75)
}
&_square{
.btn-square(1);
&.sf-btn_size_s{
.btn-square(.75)
}
}
}
Answer the question
In order to leave comments, you need to log in
Try like this:
.sf-btn {
&_size_s{
width: 100px;
}
&_square{
border-radius: 0;
}
&_square&_size_s{
width: 110px;
}
}
sf-btn_square
→sf-btn_type_square
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question