Answer the question
In order to leave comments, you need to log in
Is it allowed, according to the BEM methodology, not to assign BEM classes to some tags inside the layout, but to leave elements without classes at all?
Is it allowed, according to the BEM methodology, within the BEM layout not to assign BEM classes to some tags, but to leave elements without classes at all?
Example:
<ul class="menu__links">
<li><a class="menu__link" href="#about">О нас</a></li>
<li><a class="menu__link" href="#portfolio">Наши работы</a></li>
...
</ul>
Answer the question
In order to leave comments, you need to log in
Well, if you think logically: the element has a purpose, and since there is a purpose, there must be a class that describes this purpose. And if there is no assignment, then "what the hell is not needed" is not the class, but the element itself
https://ru.bem.info/methodology/solved-problems/
Of course, I'm not a "CSS tag curator", but according to BEM it is allowed for tags to have no classes.
Why do I think so?
1) The documentation does not say anywhere that each tag inside the block must have a class.
2) In the BEM context, "tag" !== "element".
For example, if there is an "element" containing text content, there is no point in giving a class to a tag , and even to a tag if its appearance suits you.
3) Yandex itself (the creator of BEM) quietly leaves tags without classes. An example on this page https://yandex.ru/dev/maps/mapsapi/
If you look at the code, you can see that paragraphs, links, lists, "highlighted" text do not have classes. If the creators themselves do this, then you can too :) <strong>
<p>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question