html - CSS trends with naming class and id with dash underscore? -


i've been using dashes separator css class , id names:

.about-us .car-pricing-guide 

i've seen sites use multiple underscores __

.home__content 

also, i've seen 2 dashes

.hero--title 

i know it's matter of preference can point articles or though process these kind of patterns? there move towards particular convention or there popular set of convention people seem agree/follow?

the double underscore follows bem methodology. way of naming classes later becomes easy user understand.

the guiding principle behind bem seems "when designing page, think in terms of reusable widgets". pretty standard way should writing semantic html.

learn more bem here: bem methoodology


Comments

Popular posts from this blog

javascript - Hide toolbar of pdf file opened inside iframe using firefox -

Ansible - ERROR! the field 'hosts' is required but was not set -

Copy range with conditional formatting -