Performance: Combining & with BEM naming
MEDIUM IMPACT
This affects CSS selector matching speed and rendering performance by how selectors are combined and scoped.
.block { &__element { color: red; } &__element--modifier { color: blue; } }
.block__element { color: red; } .block__element--modifier { color: blue; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Repeated full BEM selectors | No extra DOM nodes | 0 | Low but slower style matching | [X] Bad |
| Nested & with BEM selectors | No extra DOM nodes | 0 | Low and faster style matching | [OK] Good |