mirror of https://github.com/sveltejs/svelte
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
375 B
27 lines
375 B
6 years ago
|
<script>
|
||
|
import Hoverable from './Hoverable.svelte';
|
||
|
</script>
|
||
|
|
||
4 years ago
|
<Hoverable>
|
||
|
<div class:active={hovering}>
|
||
|
{#if hovering}
|
||
|
<p>I am being hovered upon.</p>
|
||
|
{:else}
|
||
|
<p>Hover over me!</p>
|
||
|
{/if}
|
||
|
</div>
|
||
|
</Hoverable>
|
||
|
|
||
6 years ago
|
<style>
|
||
|
div {
|
||
|
padding: 1em;
|
||
|
margin: 0 0 1em 0;
|
||
|
background-color: #eee;
|
||
|
}
|
||
|
|
||
|
.active {
|
||
|
background-color: #ff3e00;
|
||
|
color: white;
|
||
|
}
|
||
1 year ago
|
</style>
|