Css class name problem

div.model__mask

see that others use double sliding lines to divide class names, does this mean anything in the world? (for example, const uses uppercase to make it easier to distinguish types.) Why not use a single slide line, or a crossbar?

Mar.30,2021

this is the BEM nomenclature

uses the BEM naming convention, which theoretically has only one selector per line of css code.

BEM stands for "block (block), element (element), modifier (modifier)", and we often use these three entities to develop components.

in the selector, the extended relationship is represented by the following three symbols:

Dash in
  • : used only as a hyphen to indicate a connection token between multiple words of a block or a child element.

_ _ double underscore: the double underscore is used to connect the block and the child elements of the block
_ single underscore: the single underscore is used to describe the state of a block or the child elements of a block

I hope my answer can help you. Thank you


jianghu generally uses-to connect. _ _ this depends on what meaning you define for him.


is usually written in the following ways:
1: hump
2: connect with horizontal bars (single / pair)
3: connect with underscore (single / pair)

as far as I'm concerned, it's just a matter of code style. It depends on how your company regulates it, and it uses whatever it says.
carrots and vegetables have their own preferences.

you can take a look at the article here: https://css-tricks.com/bem-101/

.

doesn't make any sense, just keep agreeing and don't mix it up, such as

//
model__mask
model_mask
model-mask
modelMask
Menu