mirror of https://github.com/sveltejs/svelte
escape backslashes in CSS for custom elements - fixes #872
parent
30f223b54c
commit
e83bcb0b53
@ -0,0 +1,13 @@
|
|||||||
|
<span class='icon'></span>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.icon::before {
|
||||||
|
content: '\ff'
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
tag: 'custom-element'
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,13 @@
|
|||||||
|
import * as assert from 'assert';
|
||||||
|
import CustomElement from './main.html';
|
||||||
|
|
||||||
|
export default function (target) {
|
||||||
|
new CustomElement({
|
||||||
|
target
|
||||||
|
});
|
||||||
|
|
||||||
|
const icon = target.querySelector('custom-element').shadowRoot.querySelector('.icon');
|
||||||
|
const before = getComputedStyle(icon, '::before');
|
||||||
|
|
||||||
|
assert.equal(before.content, JSON.stringify(String.fromCharCode(0xff)));
|
||||||
|
}
|
Loading…
Reference in new issue