Quamis
Quamis

Reputation: 11077

what's the disadvantage of having lots of css selectors?

What is the disadvantage of having many CSS selectors?

Are there any performance problems associated with having lots of CSS selectors? Any links/real tests?

I've found https://addons.mozilla.org/en-us/firefox/addon/css-usage/ and the only reason why i see its use is because it might help removing unused CSS classes from the final CSS so it would be smaller. But its cached by the browser anyway so i see a problem with its size.

Upvotes: 0

Views: 303

Answers (1)

Jon Hanna
Jon Hanna

Reputation: 113232

It has a mild effect on render performance, but the main reason for avoiding it is that it tends to be a bad smell, indicating complicated overrides between different rules, resulting in a hard-to-maintain stylesheet.

Upvotes: 6

Related Questions