"#app :is(.foo[data-v-test]) { color: red;
}"
`)
+
+ expect(compileScoped(`#app :is(:is(.foo)) { color: red; }`))
+ .toMatchInlineSnapshot(`
+ "#app :is(:is(.foo[data-v-test])) { color: red;
+ }"
+ `)
+
+ expect(compileScoped(`#app :where(.foo) { color: red; }`))
+ .toMatchInlineSnapshot(`
+ "#app :where(.foo[data-v-test]) { color: red;
+ }"
+ `)
+
+ expect(compileScoped(`#app :where(:where(.foo)) { color: red; }`))
+ .toMatchInlineSnapshot(`
+ "#app :where(:where(.foo[data-v-test])) { color: red;
+ }"
+ `)
})
test('media query', () => {
(n.type !== 'pseudo' && n.type !== 'combinator') ||
(n.type === 'pseudo' &&
(n.value === ':is' || n.value === ':where') &&
- (!node || !n.nodes.some(n => n.nodes.some(x => x.type === 'pseudo'))))
+ (!node ||
+ n.nodes.some(
+ s =>
+ // has nested :is or :where
+ s.nodes.some(x => x.type === n.type && x.value === n.value) ||
+ // has non-pseudo selector
+ !s.nodes.some(x => x.type === 'pseudo'),
+ )))
) {
node = n
}