}"
`)
expect(compileScoped(`.foo * { color: red; }`)).toMatchInlineSnapshot(`
- ".foo[data-v-test] [data-v-test] { color: red;
+ ".foo[data-v-test] :where([data-v-test]) { color: red;
}"
`)
expect(compileScoped(`.foo :active { color: red; }`))
`)
expect(compileScoped(`.foo *:active { color: red; }`))
.toMatchInlineSnapshot(`
- ".foo[data-v-test] [data-v-test]:active { color: red;
+ ".foo[data-v-test] :where([data-v-test]):active { color: red;
}"
`)
expect(compileScoped(`.foo * .bar { color: red; }`)).toMatchInlineSnapshot(`
`)
expect(compileScoped(`:last-child * { color: red; }`))
.toMatchInlineSnapshot(`
- "[data-v-test]:last-child [data-v-test] { color: red;
+ "[data-v-test]:last-child :where([data-v-test]) { color: red;
}"
`)
expect(compileScoped(`:last-child *:active { color: red; }`))
.toMatchInlineSnapshot(`
- "[data-v-test]:last-child [data-v-test]:active { color: red;
+ "[data-v-test]:last-child :where([data-v-test]):active { color: red;
}"
`)
})
}
}
// store the universal selector so it can be rewritten later
- // .foo * -> .foo[xxxxxxx] [xxxxxxx]
+ // .foo * -> .foo[xxxxxxx] :where([xxxxxxx])
starNode = n
}
}),
)
// Used for trailing universal selectors (#12906)
- // `.foo * {}` -> `.foo[xxxxxxx] [xxxxxxx] {}`
+ // `.foo * {}` -> `.foo[xxxxxxx] :where([xxxxxxx]) {}`
if (starNode) {
selector.insertBefore(
starNode,
- selectorParser.attribute({
- attribute: idToAdd,
- value: idToAdd,
- raws: {},
- quoteMark: `"`,
+ selectorParser.pseudo({
+ value: ':where',
+ nodes: [
+ selectorParser.attribute({
+ attribute: idToAdd,
+ value: idToAdd,
+ raws: {},
+ quoteMark: `"`,
+ }),
+ ],
}),
)
selector.removeChild(starNode)