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

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

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -