Use duplicate class name for element?
I found that there are many frameworks out there that will check for a duplicate class name before adding a new class name to the element, which I think will slow down performance.
Are there any problems if the element has a double class name?
It will also apply the CSS class without conflicts while using the name of the duplicate class.
<div class="aa bb cc aa"></div>
Is it possible to add a class name just like elem.className += ' ' + 'aa ee'
, even an element has a duplicate class name?
source to share
Semantic interface makes heavy use of attribute selectors
like here
.ui.grid [class*="left floated"].column {
margin-right: auto;
}
.ui.grid [class*="right floated"].column {
margin-left: auto;
}
If you want margin-left
and margin-right
have auto value
, you must have a duplicate of the class, floated
(for example <div class="left floated right floated">Lorem</div>
)
source to share