Repository navigation
fix(compiler-sfc): auto add nesting selector for nesting ::v-deep - #13163
edison1105 wants to merge 2 commits into
Conversation
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;
} |
|
Oh, I didn't realize there was a pull request for this! I added a note over here: #13159 (comment). I'd really prefer to see Vue adhering to the CSS spec in this case, rather than deviating from it further. |
close #13159