Search code examples
cssmobile-website

Is there much performance gain from using as few CSS classes as possible?


Recently I've come upon a mobile UI kit which used very long CSS class names, seemingly instead of utilizing multiple class names and CSS inheritance (e.g. ".container-element-subelement"). Is there much performance gain from this? Because it sounds like a nightmare to have to maintain those stylesheets later.


Solution

  • Performance gain from what you referred to should be negligible (of course, depends on the user's hardware, the page size, and browser).

    There was some discussion on this here: CSS child selector performance vs. class bloat