You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Overly long CSS selectors can negatively impact performance. Browsers evaluate selectors from right to left, meaning long chains require more processing. Deeply nested selectors (e.g., body div#container ul.nav li a) force the browser to check each level, slowing down rendering. While modern browsers optimize selector matching, unnecessary complexity still harms maintainability and scalability.
What type of rule is this?
Warns about a potential problem
Example code
/* Too specific and slow */bodydiv#main-containersection.blogarticle.postdiv.contentp.texta.link {
margin-left:20px;
}
Participation
I am willing to submit a pull request to implement this rule.
Additional comments
No response
The text was updated successfully, but these errors were encountered:
Thanks for the suggestion. "excessively long" isn't specific enough for a rule, and everyone's idea of what a too-long or too-complex selector is different.
This is really a subset of what we were discussing on #19
Rule details
Overly long CSS selectors can negatively impact performance. Browsers evaluate selectors from right to left, meaning long chains require more processing. Deeply nested selectors (e.g., body div#container ul.nav li a) force the browser to check each level, slowing down rendering. While modern browsers optimize selector matching, unnecessary complexity still harms maintainability and scalability.
What type of rule is this?
Warns about a potential problem
Example code
Participation
Additional comments
No response
The text was updated successfully, but these errors were encountered: