Repository navigation
Conversation
fix #13746 When using scoped styles with state pseudo classes in compound selectors (e.g., .root:hover .a), the scoped attribute was incorrectly injected after the pseudo class instead of before it. This caused the scoped style to leak to external components when they had matching class names. The fix injects the scoped attribute (data-v-xxx) before state pseudo classes like :hover, :focus, :active, etc., ensuring proper scoping.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis change fixes scoped style handling for state pseudo-classes in compound selectors by introducing a regex pattern to identify state pseudo-classes and logic to inject the scoped attribute before them, ensuring selectors like Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
fix #13746
When using scoped styles with state pseudo classes in compound selectors (e.g.,
.root:hover .a), the scoped attribute was incorrectly injected after the pseudo class instead of before it.Before (incorrect):
After (correct):
This caused the scoped style to leak to external components when they had matching class names.
How did you test this change?
Summary by CodeRabbit
Bug Fixes
:hover,:focus) in compound selectors, ensuring the scope attribute is correctly positioned in generated CSS output.Tests