Performance: Naming conventions
MEDIUM IMPACT
Naming conventions affect CSS selector performance and maintainability, impacting how quickly browsers match styles to elements.
.nav-link:hover { color: red; }
.header .nav ul li a:hover { color: red; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Deep descendant selectors (.header .nav ul li a:hover) | High (many elements checked) | 0 | Low | [X] Bad |
| Flat class selectors (.nav-link:hover) | Low (direct match) | 0 | Low | [OK] Good |