0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

put attribute selector before pseudo-class selector - fixes #658

This commit is contained in:
Rich Harris 2017-06-23 08:47:51 -04:00
parent 1ce6cfaa68
commit b07f303780
4 changed files with 35 additions and 0 deletions

View File

@ -87,6 +87,11 @@ export default function processCss(
shouldTransform = false;
}
else if (child.type === 'PseudoElementSelector') {
code.prependRight(c, attr);
shouldTransform = false;
}
c = child.end;
});

View File

@ -0,0 +1,3 @@
export default {
cascade: false
};

View File

@ -0,0 +1,12 @@
span[svelte-583610229]::after {
content: 'i am a pseudo-element';
}
span[svelte-583610229]:first-child {
color: red;
}
span[svelte-583610229]:last-child::after {
color: blue;
}

View File

@ -0,0 +1,15 @@
<span></span>
<style>
span::after {
content: 'i am a pseudo-element';
}
span:first-child {
color: red;
}
span:last-child::after {
color: blue;
}
</style>