mirror of https://github.com/sveltejs/svelte
Merge pull request #3432 from sveltejs/gh-1830
bail out of style tag optimisation when appropriatepull/3437/head
commit
63a7a37bb7
@ -0,0 +1,20 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<p style="opacity: 0.5; color: red">color: red</p>
|
||||||
|
`,
|
||||||
|
|
||||||
|
test({ assert, component, target, window }) {
|
||||||
|
const p = target.querySelector('p');
|
||||||
|
|
||||||
|
let styles = window.getComputedStyle(p);
|
||||||
|
assert.equal(styles.opacity, '0.5');
|
||||||
|
assert.equal(styles.color, 'red');
|
||||||
|
|
||||||
|
component.styles = 'font-size: 20px';
|
||||||
|
|
||||||
|
styles = window.getComputedStyle(p);
|
||||||
|
assert.equal(styles.opacity, '0.5');
|
||||||
|
assert.equal(styles.color, '');
|
||||||
|
assert.equal(styles.fontSize, '20px');
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
<script>
|
||||||
|
export let styles = `color: red`;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<p style="opacity: 0.5; {styles}">{styles}</p>
|
Loading…
Reference in new issue