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:
it allows identify framework specific classes (vs may have added)
it reduces chance of collision own classes
the classes written relate purpose, splitting them may abstract meaning of class purpose
Comments
Post a Comment