R
R
Roma Zvarich2019-06-28 15:23:25
BEM
Roma Zvarich, 2019-06-28 15:23:25

BEM modifier separation: underscore or two hyphens?

Hello.
The official BEM documentation says that the modifier should be separated by an underscore
block_modificator
5d16069ee192c687305716.png
. 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

1 answer(s)
N
NaN, 2019-06-28
@hisbvdis

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 question

Ask a Question

731 491 924 answers to any question