-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Open
Labels
Description
docs/src/api/sfc-css-features.md
Line 101 in 4cbc64e
| - **Scoped styles do not eliminate the need for classes**. Due to the way browsers render various CSS selectors, `p { color: red }` will be many times slower when scoped (i.e. when combined with an attribute selector). If you use classes or ids instead, such as in `.example { color: red }`, then you virtually eliminate that performance hit. |
After reading this part of the docs, I got curious about the performance impact of attribute selectors, but could not find any conclusive evidence one way or the other. Lots of dead links, 10+ years old articles and presentations with general advice but no benchmarks, etc. The closest thing I got was this issue, which apparently only affects IE11.
It would be great to have some context on the issue of attribute selector performance and if the mentioned performance penalty still exists today (maybe in the form of "further reading" links).