开发者

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

开发者 https://www.devze.com 2023-02-17 10:51 出处:网络
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?

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 o开发者_如何学运维nly 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消