For situations where I need to set special-case widths of elements, I've been using some utility classes like width--8em
. I considered at first that this would be more maintainable but now I'm starting to wonder because I end up with so many one-off classes. Is there a performance advantage regarding reflow one way or the other? Any other maintainability advice welcome.
class
<div class="width--5rem">example</div>
with CSS like
.width--5rem {
width: 5rem;
}
style
<div style="width: 5rem">example</div>