-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
fix(compiler-sfc): improve scoped style rewriting for nested and non-pseudo :is/:where selectors #12244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
Maybe it's another bug that I reproduced on the current official playground I created a new issue to track it #12252 |
According to the document, I believe the behavior with this PR is proper. |
This pr is correct, you are so cool @edison1105 |
I'm wondering about nesting A selector like |
WalkthroughThe changes update the logic for handling scoped CSS selectors, specifically improving how nested Changes
Sequence Diagram(s)sequenceDiagram
participant TestSuite
participant Compiler
participant SelectorRewriter
TestSuite->>Compiler: Compile SFC with scoped CSS
Compiler->>SelectorRewriter: Rewrite selectors for scoping
SelectorRewriter->>SelectorRewriter: Check for :is()/:where() (including nesting)
SelectorRewriter->>SelectorRewriter: Inject scoped attribute as needed
SelectorRewriter-->>Compiler: Return rewritten selectors
Compiler-->>TestSuite: Output compiled CSS
Assessment against linked issues
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@skirtles-code |
close #12241
Summary by CodeRabbit
Bug Fixes
:is()
and:where()
pseudo-classes, ensuring the scoped attribute is correctly applied in complex selector scenarios.Tests
:is()
and:where()
selectors with ID prefixes.