mirror of https://github.com/sveltejs/svelte
parent
1770fc140a
commit
1964535adf
@ -0,0 +1,18 @@
|
||||
export default {
|
||||
html: `
|
||||
<div style="background-color: rgb(255, 0, 0);"></div>
|
||||
`,
|
||||
|
||||
test({ assert, target, window, component }) {
|
||||
const div = target.querySelector('div');
|
||||
const styles = window.getComputedStyle(div);
|
||||
assert.equal(styles.backgroundColor, 'rgb(255, 0, 0)');
|
||||
|
||||
{
|
||||
component.backgroundColor = 128;
|
||||
const div = target.querySelector('div');
|
||||
const styles = window.getComputedStyle(div);
|
||||
assert.equal(styles.backgroundColor, 'rgb(128, 0, 0)');
|
||||
}
|
||||
}
|
||||
};
|
@ -0,0 +1,5 @@
|
||||
<script lang="ts">
|
||||
export let backgroundColor = 255;
|
||||
</script>
|
||||
|
||||
<div style:background-color="rgb({backgroundColor}, 0, 0)" {...$$restProps} />
|
Loading…
Reference in new issue