Fix Button styling
This commit is contained in:
@@ -2,15 +2,20 @@
|
||||
export let text: string
|
||||
export let tag: string = 'a'
|
||||
export let url: string = undefined
|
||||
|
||||
const classes = [
|
||||
'button',
|
||||
$$props.class
|
||||
].join(' ')
|
||||
</script>
|
||||
|
||||
{#if tag === 'button'}
|
||||
<button class="button {$$props.class}">
|
||||
<button class={classes}>
|
||||
<slot />
|
||||
{text}
|
||||
</button>
|
||||
{:else if tag === 'a'}
|
||||
<a href={url} class="button {$$props.class}">
|
||||
<a href={url} class={classes}>
|
||||
<slot />
|
||||
<span>{text}</span>
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user