mirror of https://github.com/sveltejs/svelte
Merge pull request #873 from sveltejs/gh-872
escape backslashes in CSS for custom elementspull/883/head
commit
bcad4171ce
@ -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