Answer the question
In order to leave comments, you need to log in
How to correctly divide into blocks, elements and modifiers?
I read about bem, tried it 2 times when building websites, I liked it. The same question was already asked on the toaster, but I still can’t figure out what to do if I have 3 levels of nesting.
Here is an example (I will write in jade)
.contatcs
.left-side
.title
.accordion
ul
.right-side
.contacts
.contacts__left-side
contacts__left-side_title? contacts__left-side__title?
.accordion
.accordion__elem
.accordion__elem2
.contacts__right-side
.contacts__left-side title {
css
}
Answer the question
In order to leave comments, you need to log in
In this case, left-side and right-side should be made blocks. Bem has no such thing as an element within an element. If this happens, then the top element should be made a block
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question