mirror of https://github.com/sveltejs/svelte
bail out of style tag optimisation when appropriate - fixes #1830
parent
51498421bb
commit
d720f0bb00
@ -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