Browser & Web Performance · Senior · Question 11 of 75
Why can a single class change on <body> be expensive in a large app?
- ✓Correct answer: It can invalidate styles for the whole subtree, forcing a style recalculation of thousands of elements
- 2It triggers a new network request for CSS
- 3It resets all event listeners
Explanation
Style recalculation cost depends on how many elements are affected and how complex the selectors matching them are.