Performance: Debugging specificity issues
MEDIUM IMPACT
This affects how quickly styles are applied and can impact rendering speed if many conflicting rules cause repeated style recalculations.
.item-active-link { color: red; font-weight: bold; }
div.content > ul li.item.active a:hover { color: red; font-weight: bold; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Complex selector with many combinators | High (many nodes matched repeatedly) | Multiple on state changes | High due to frequent recalculations | [X] Bad |
| Simple class selector | Low (direct match) | Single or none | Low, minimal recalculations | [OK] Good |