Answer the question
In order to leave comments, you need to log in
Is it correct to write like this (bem)?
The subject
itself
<!-- .header -->
<section class="header">
<div class="container">
<div class="header__top">
<div class="header__logotype">
<a href="#" class="header_logotype_link">
<img src="_tmp/logotype.png" alt="Casino" class="header_logotype_image">
</a>
</div>
</div>
</div>
</section>
<!-- /.header -->
.header {
&__top {
}
&__logotype {
&_link {
}
&_image {
}
}
}
Answer the question
In order to leave comments, you need to log in
No, it's wrong.
BEM is needed to avoid nesting. That's right
.header {
$parent: &;
&__top {
}
&__logotype {
}
#{$parent}_link {
}
#{$parent}_image {
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question