We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f0f944 commit 184da1aCopy full SHA for 184da1a
packages/compiler-sfc/src/style/pluginScoped.ts
@@ -139,17 +139,10 @@ function rewriteSelector(
139
// .foo { ::v-deep(.bar) } -> .foo { &[xxxxxxx] .bar }
140
const isNestedRule = rule.parent && rule.parent.type === 'rule'
141
if (isNestedRule && n.parent) {
142
- let hasNestingCombinator = false
143
- let index = n.parent.index(n) - 1
144
- while (index >= 0) {
145
- const prev = n.parent.at(index)
146
- if (!prev) break
147
- if (prev.type === 'nesting') {
148
- hasNestingCombinator = true
149
- break
150
- }
151
- index--
152
+ const hasNestingCombinator = n.parent.nodes
+ .slice(0, n.parent.index(n))
+ .some(node => node.type === 'nesting')
+
153
if (!hasNestingCombinator) {
154
node = selectorParser.nesting()
155
selector.insertBefore(n, node)
0 commit comments