Answer the question
In order to leave comments, you need to log in
How to do BEM?
Hello.
For example, there are two blocks with social networks:
<ul class="socials">
...
</ul>
.socials {
color: #000;
}
Answer the question
In order to leave comments, you need to log in
If the differences are stylistic, that is, it can be assumed that one of the two options can be used anywhere, then it is better to do it through a modifier with a key and its value. For example:
socials_theme_ligth
socials_theme_dark
where theme is the key and ligth and dark are its values, which cannot be used simultaneously on the same block.
For the rest of the changes that only need to be made to the footer, we apply the mix . For example, we need a light theme, but in the footer we need to add an indent from above or some other changes in this context. It might look like this:
<ul class="footer__socials socials socials_theme_ligth">
...
</ul>
.socials {
color: #000;
}
.socials_theme_ligth {
color: #fff;
}
.footer__socials {
margin-top: 100px
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question