File tree 2 files changed +26
-1
lines changed 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -249,6 +249,24 @@ color: red
249
249
"#app :is(.foo[data-v-test]) { color: red;
250
250
}"
251
251
` )
252
+
253
+ expect ( compileScoped ( `#app :is(:is(.foo)) { color: red; }` ) )
254
+ . toMatchInlineSnapshot ( `
255
+ "#app :is(:is(.foo[data-v-test])) { color: red;
256
+ }"
257
+ ` )
258
+
259
+ expect ( compileScoped ( `#app :where(.foo) { color: red; }` ) )
260
+ . toMatchInlineSnapshot ( `
261
+ "#app :where(.foo[data-v-test]) { color: red;
262
+ }"
263
+ ` )
264
+
265
+ expect ( compileScoped ( `#app :where(:where(.foo)) { color: red; }` ) )
266
+ . toMatchInlineSnapshot ( `
267
+ "#app :where(:where(.foo[data-v-test])) { color: red;
268
+ }"
269
+ ` )
252
270
} )
253
271
254
272
test ( 'media query' , ( ) => {
Original file line number Diff line number Diff line change @@ -225,7 +225,14 @@ function rewriteSelector(
225
225
( n . type !== 'pseudo' && n . type !== 'combinator' ) ||
226
226
( n . type === 'pseudo' &&
227
227
( n . value === ':is' || n . value === ':where' ) &&
228
- ( ! node || ! n . nodes . some ( n => n . nodes . some ( x => x . type === 'pseudo' ) ) ) )
228
+ ( ! node ||
229
+ n . nodes . some (
230
+ s =>
231
+ // has nested :is or :where
232
+ s . nodes . some ( x => x . type === n . type && x . value === n . value ) ||
233
+ // has non-pseudo selector
234
+ ! s . nodes . some ( x => x . type === 'pseudo' ) ,
235
+ ) ) )
229
236
) {
230
237
node = n
231
238
}
You can’t perform that action at this time.
0 commit comments