CSS BEM that points to the modifier ..?

I'm not sure which official site I found getbem.com and en.bem.info .

One suggests using --for a modifier ( Naming ):

A CSS class is formed as the name of blocks or elements plus two dashes.

Another _for modifier ( Modifier name ):

The modifier name is limited to one underscore (_).

I know what I can use, and in fact it is simply important to be consistent, but I prefer to use official specifications when possible.

  • What is the official website ..?
  • Should I use --or _for modifiers ..?
+4
source share
1 answer

What is the official website?

BEM started as an unofficial set of Yandex recommendations , which they later drafted on en.bem.info , therefore it en.bem.infois a β€œcanonical” version of BEM in this regard .

With that said, there are many variations of BEM, and I myself use an option that is heavily dependent on Harry Roberts and Nicholas Gallagher .

This brings me to the following question:

Should I use --or _for modifiers?

: , , BEM, . , , .

(vs hotdogs). , , .

, , , , :

:

the-block__the-element--the-modifier

:

TheBlock_theElement-theModifier

.

+3

Source: https://habr.com/ru/post/1676479/


All Articles