Answer the question
In order to leave comments, you need to log in
BEM modifiers for text?
An idea came to mind. There are often paragraphs or spans in the code that contain text that does not particularly have a semantic meaning and needs to be changed a little (usually the font size or text color) So, is it possible to make a .text class according to BEM rules (for p and span ) and add a bunch of modifiers like text_size_m, text_size_l, etc. for this class. Then use them on the appropriate node, for example:
<p class="text text_size_l">random useless text</p>
Answer the question
In order to leave comments, you need to log in
No, it doesn't contradict BEM rules. You can do it, yes. Another thing is that you can get away from the imperative enumeration of how the element looks like, and give the element a declarative class that describes what it is for. For example, disclaimer or quote .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question