A
A
Arman2018-06-18 12:52:49
Layout
Arman, 2018-06-18 12:52:49

How to correctly name blocks according to BEM in a large project?

DD.
What will be the class .news-listin styles for you? news list? but where?
Let's say the first programmer calls the main block with the list of news on the page of the News list.
Further/later, the second programmer raises the list of top news on the main page and also names the main block .news-list. There is also a terrible modal menu sent by designers, where you also need to show a couple of news and again manage to name.news-listparent block with news. Naturally, the appearance of these lists is different everywhere, an attempt to correct the style in one place leads to the fact that something breaks on the other side. I understand that it is possible to make edits according to the parent, but how is it correct according to BEM? it is clear that they want to make bricks and use them everywhere, but how to make bricks not break something else? how to distinguish and remember which bricks are already there?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iBird Rose, 2018-06-18
@Arik

for this, BEM has https://ru.bem.info/methodology/block-modification...
i.e. in your case it should be something like:
.news-list.in-main
.news-list.in-news-page
.news-list.in-modal
and style each accordingly

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question