add scoping attribute for pseudo-class selectors without a type/class - fixes #1705

pull/3141/head
Richard Harris 5 years ago
parent 220515b605
commit 0fd34b1f41

@ -61,7 +61,10 @@ export default class Selector {
let i = block.selectors.length;
while (i--) {
const selector = block.selectors[i];
if (selector.type === 'PseudoElementSelector' || selector.type === 'PseudoClassSelector') continue;
if (selector.type === 'PseudoElementSelector' || selector.type === 'PseudoClassSelector') {
if (i === 0) code.prependRight(selector.start, attr);
continue;
}
if (selector.type === 'TypeSelector' && selector.name === '*') {
code.overwrite(selector.start, selector.end, attr);

@ -0,0 +1 @@
.svelte-xyz:not(.foo){color:red}

@ -0,0 +1,8 @@
<p class="foo">foo</p>
<p class="bar">bar</p>
<style>
:not(.foo) {
color: red;
}
</style>
Loading…
Cancel
Save