Answer the question
In order to leave comments, you need to log in
BEM modifier separation: underscore or two hyphens?
Hello.
The official BEM documentation says that the modifier should be separated by an underscore block_modificator
. But I often see the separation with two hyphens. block--modificator
And visually, this method seems to me more readable.
There is a temptation to switch to such a designation.
Please help me to understand:
1) Why even "prominent" developers, it turns out, do not follow the documentation, separating the modifier with two hyphens?
2) Is it allowed to use "--" instead of "_"?
Thanks
Answer the question
In order to leave comments, you need to log in
It is worth reading "Alternative naming schemes"
Here, everyone simply chooses a convenient option for themselves, or the one that is used in your team, for example.
Often code editors are set to a standard naming scheme, so it's more convenient for someone to use it. But everything can be edited if you want.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question