mirror of https://github.com/sveltejs/svelte
parent
3c1591cace
commit
4969b6c6a4
@ -0,0 +1,16 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<p style="color: red; width: 65px; font-weight: 700;"></p>
|
||||||
|
`,
|
||||||
|
|
||||||
|
test({ assert, component, target, window }) {
|
||||||
|
const p = target.querySelector('p');
|
||||||
|
|
||||||
|
const styles = window.getComputedStyle(p);
|
||||||
|
assert.equal(styles.color, 'red');
|
||||||
|
},
|
||||||
|
|
||||||
|
skip_if_ssr: true
|
||||||
|
// SSR renders "null" string for null values:
|
||||||
|
// <p style="color: red; width: 65px; position: null; font-weight: 700;"></p>
|
||||||
|
};
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<script>
|
||||||
|
export let myColor = "red";
|
||||||
|
export let width = "65px";
|
||||||
|
export let absolute = false;
|
||||||
|
export let bold = true;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<p
|
||||||
|
style:color={myColor}
|
||||||
|
style:width
|
||||||
|
style:position={absolute ? "absolute" : null}
|
||||||
|
style:font-weight={bold ? 700 : 100}
|
||||||
|
/>
|
||||||
Loading…
Reference in new issue