V
V
Vladislav Bezenson2015-10-16 10:40:22
css
Vladislav Bezenson, 2015-10-16 10:40:22

Have I understood the essence of class naming in BEM correctly?

I have a relatively large nesting of blocks in blocks and the classes are as follows:
.news-grid- news grid
.news-grid__item- news element
.news-grid__item__more-btn- "Read more" button in the news element
.news-grid__item__more-btn__icon- an icon with an arrow in this button.
And so the classes can grow even more. Is this normal or am I not understanding something?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
VisualIdeas, 2015-10-16
@VisualIdeas

Not quite right.
If you want the whole news grid to be one block, and not grid=block + news=block, then in your case it would be logical to use this:
.news-grid - news grid
.news-grid__item - news element (probably news element)
. news-grid__more-btn - the button "Read more" in the news element
.news-grid__btn-icon - the icon with an arrow in this button.
Block__Element--Modifier, not Block__Element__Element--Modifier)))
The name is BEM, not BEEEM...
Watch the video www.youtube.com/watch?v=kBgHdSOj33A - short and clear

R
rhost, 2015-10-16
@hoOstel

If I understand correctly, then yes, it is.
For me, BEM is just complications, what are the advantages of this BEM xs)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question