File tree Expand file tree Collapse file tree 2 files changed +16
-11
lines changed Expand file tree Collapse file tree 2 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -493,7 +493,7 @@ describe('SFC style preprocessors', () => {
493
493
}"
494
494
` )
495
495
expect ( compileScoped ( `.foo * { color: red; }` ) ) . toMatchInlineSnapshot ( `
496
- ".foo[data-v-test] [data-v-test] { color: red;
496
+ ".foo[data-v-test] :where( [data-v-test]) { color: red;
497
497
}"
498
498
` )
499
499
expect ( compileScoped ( `.foo :active { color: red; }` ) )
@@ -503,7 +503,7 @@ describe('SFC style preprocessors', () => {
503
503
` )
504
504
expect ( compileScoped ( `.foo *:active { color: red; }` ) )
505
505
. toMatchInlineSnapshot ( `
506
- ".foo[data-v-test] [data-v-test]:active { color: red;
506
+ ".foo[data-v-test] :where( [data-v-test]) :active { color: red;
507
507
}"
508
508
` )
509
509
expect ( compileScoped ( `.foo * .bar { color: red; }` ) ) . toMatchInlineSnapshot ( `
@@ -512,12 +512,12 @@ describe('SFC style preprocessors', () => {
512
512
` )
513
513
expect ( compileScoped ( `:last-child * { color: red; }` ) )
514
514
. toMatchInlineSnapshot ( `
515
- "[data-v-test]:last-child [data-v-test] { color: red;
515
+ "[data-v-test]:last-child :where( [data-v-test]) { color: red;
516
516
}"
517
517
` )
518
518
expect ( compileScoped ( `:last-child *:active { color: red; }` ) )
519
519
. toMatchInlineSnapshot ( `
520
- "[data-v-test]:last-child [data-v-test]:active { color: red;
520
+ "[data-v-test]:last-child :where( [data-v-test]) :active { color: red;
521
521
}"
522
522
` )
523
523
} )
Original file line number Diff line number Diff line change @@ -218,7 +218,7 @@ function rewriteSelector(
218
218
}
219
219
}
220
220
// store the universal selector so it can be rewritten later
221
- // .foo * -> .foo[xxxxxxx] [xxxxxxx]
221
+ // .foo * -> .foo[xxxxxxx] :where( [xxxxxxx])
222
222
starNode = n
223
223
}
224
224
@@ -280,15 +280,20 @@ function rewriteSelector(
280
280
} ) ,
281
281
)
282
282
// Used for trailing universal selectors (#12906)
283
- // `.foo * {}` -> `.foo[xxxxxxx] [xxxxxxx] {}`
283
+ // `.foo * {}` -> `.foo[xxxxxxx] :where( [xxxxxxx]) {}`
284
284
if ( starNode ) {
285
285
selector . insertBefore (
286
286
starNode ,
287
- selectorParser . attribute ( {
288
- attribute : idToAdd ,
289
- value : idToAdd ,
290
- raws : { } ,
291
- quoteMark : `"` ,
287
+ selectorParser . pseudo ( {
288
+ value : ':where' ,
289
+ nodes : [
290
+ selectorParser . attribute ( {
291
+ attribute : idToAdd ,
292
+ value : idToAdd ,
293
+ raws : { } ,
294
+ quoteMark : `"` ,
295
+ } ) ,
296
+ ] ,
292
297
} ) ,
293
298
)
294
299
selector . removeChild ( starNode )
You can’t perform that action at this time.
0 commit comments