Files
housesof/src/atoms/Button.svelte
Félix Péault 37c5cb2c4e
All checks were successful
continuous-integration/drone/push Build is passing
Bring back the sapper-noscroll attribute
Window scroll is now been triggered manually during the page transition and not automatically by Sapper
2020-04-04 11:46:17 +02:00

24 lines
544 B
Svelte

<script>
export let href = '#'
export let type = 'a'
export let text = ''
export let noScroll = undefined
</script>
{#if type === 'button'}
<button class={$$props.class ? $$props.class : 'button'} on:click>
<slot></slot>
<div class="text" data-text={text}>
<span>{text}</span>
</div>
</button>
{:else}
<a {href} class={$$props.class ? $$props.class : 'button'} on:click sapper-noscroll={noScroll}>
<slot></slot>
<div class="text" data-text={text}>
<span>{text}</span>
</div>
</a>
{/if}