0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-29 16:36:44 +01:00
svelte/documentation/examples/05-bindings/10-dimensions/App.svelte

25 lines
361 B
Svelte
Raw Normal View History

2019-03-10 20:53:01 +01:00
<script>
let w;
let h;
let size = 42;
let text = 'edit me';
</script>
2023-05-14 07:50:43 +02:00
<input type="range" bind:value={size} />
<input bind:value={text} />
2019-03-10 20:53:01 +01:00
<p>size: {w}px x {h}px</p>
<div bind:clientWidth={w} bind:clientHeight={h}>
<span style="font-size: {size}px">{text}</span>
</div>
<style>
2023-05-14 07:50:43 +02:00
input {
display: block;
}
div {
display: inline-block;
}
</style>