Skip to content

docs: clarify scoped CSS selector performance#3426

Open
ishaanlabs-gg wants to merge 1 commit into
vuejs:mainfrom
ishaanlabs-gg:docs-scoped-css-selector-performance
Open

docs: clarify scoped CSS selector performance#3426
ishaanlabs-gg wants to merge 1 commit into
vuejs:mainfrom
ishaanlabs-gg:docs-scoped-css-selector-performance

Conversation

@ishaanlabs-gg

Copy link
Copy Markdown

Description of Problem

The scoped CSS tips currently say an element selector such as p { color: red } will be "many times slower" when scoped. That warning is directionally useful, but it reads more absolute than current browser behavior warrants and does not tell readers when they should actually care.

Addresses vuejs/core#2608.

Proposed Solution

This updates the tip to explain what scoped CSS compiles to, notes that selector cost depends on the browser, selector, and affected DOM size, and keeps the practical guidance to prefer classes or ids in large or frequently updated component trees.

Additional Information

Validation:

  • git diff --check HEAD~1 HEAD

This is a docs-only wording change, so I did not run the full VitePress site build.

@netlify

netlify Bot commented Jul 2, 2026

Copy link
Copy Markdown

Deploy Preview for vuejs ready!

Name Link
🔨 Latest commit b2ec62a
🔍 Latest deploy log https://app.netlify.com/projects/vuejs/deploys/6a46a72b1d65510008901d33
😎 Deploy Preview https://deploy-preview-3426--vuejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@bencodezen bencodezen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the clarity around the browser impact to be less absolute, but I do think this rewrite hides the original message that using generic HTML selectors as scoped styles being slower performance wise.

In addition, the scoped styles is explained earlier in the section, so we should avoid re-explaining it in the tip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants