-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
fix(compiler-sfc): auto add nesting selector for nesting ::v-deep #13163
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
… CSS
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-ssr
@vue/compiler-sfc
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
184da1a
to
ae0f685
Compare
ae0f685
to
bfd11af
Compare
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
I think we'd also need to consider the case where the .foo {
.bar :deep(&) {
color: red;
}
} This works on The example above uses I'm also wondering about media queries within the nesting. e.g.: .foo {
@media (screen) {
:deep(.bar) {
color: red;
}
}
} There are quite a lot of edge cases here. Some combinations of nesting seem to work, while others don't. I'm not sure whether this would be considered in scope for this PR, as some cases fail even without |
div:deep() {
&:hover span { color: red; }
}
// 编译结果:
// 这里 :hover 前面多了个非预期的空格
div[data-v-2ecdb3cb] :hover span {
color: red;
} 而 :deep 能与 div:deep {
&:hover span { color: red; }
... 更多嵌套规则,也只需要在外层加一个 :deep
}
div[data-v-2ecdb3cb]:hover span {
color: red;
} |
close #13159