css - Which HTML CLASS definition is right solution? -


for frameworks using controls this

html <{{html_tag}} class="ui-accordion ui-widget ui-helper-reset" />

css .ui-accordion.ui-widget { {{style}} } .ui-widget.ui-helper-reset { {{style}} }

for time come me more logical this

html <{{html_tag}} class="ui accordion widget helper reset" />

css .ui.accordion.widget { {{style}} } .ui.widget.helper.reset { {{style}} }

does have pros , cons?

in first example, because framework abbreviation has been added prefix every class related framework:

  1. it allows identify framework specific classes (vs may have added)

  2. it reduces chance of collision own classes

  3. the classes written relate purpose, splitting them may abstract meaning of class purpose


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -