I
I
Ibishka2019-11-22 00:36:24
HTML
Ibishka, 2019-11-22 00:36:24

How to write id correctly in BEM too?

Should I write in BEM or camelCase or something else? I am using id in js.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pashenka, 2019-11-22
@Ibishka

The main thing is to adhere to the n̶e̶k̶o̶t̶o̶r̶o̶g̶o̶ ̶p̶l̶a̶n̶a̶ single rule. I use BEM, I write id in camelCase. If you want to be like me, write like that too.
2 minutes later: *look at my code* I have my own methodology: in camelCase, it turns out that I write id for any submits, otherwise id coincides with the class most often for ease of orientation. Don't be like me. Stick to the same rule.

D
dom1n1k, 2019-12-04
@dom1n1k

BEM does not regulate the style of writing identifiers in any way. It only forbids to hang styles on them.
In general, the most common and generally accepted practice even before BAM is kebab-case, or, simply speaking, through hyphens.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question