Performance: Basic selector nesting
MEDIUM IMPACT
This affects CSS parsing and rendering speed by influencing how browsers match selectors to elements.
nav {
a {
color: blue;
text-decoration: none;
}
}nav ul li a {
color: blue;
text-decoration: none;
}| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Deeply nested selectors | No extra DOM nodes | 0 | Higher due to slower style matching | [X] Bad |
| Shallow nesting with simple selectors | No extra DOM nodes | 0 | Lower due to faster style matching | [OK] Good |