DEV Community

Discussion on: CSS Naming conventions

Collapse
 
ziizium profile image
Habdul Hazeez

According to the quick start guide on modifier:

The modifier name is separated from the block or element name by a single underscore (_).

Your example --alert is one of the Alternative naming schemes used in the BEM community know as Two Dashes style.

You can check the examples in the naming convention section of the methodology.

Collapse
 
gracesnow profile image
Grace Snow

I have used BEM at loads of work places and never once seen the single underscore used for a modifier, always double hyphen. So much easier to read too - you should add this option into your article I think as that's much more likely to be what people encounter

Thread Thread
 
ziizium profile image
Habdul Hazeez

Thank you, I'll update the article with your contribution.

Thread Thread
 
ziizium profile image
Habdul Hazeez

Updated.

Once again, thank you.