Fix Button styling

This commit is contained in:
2021-10-02 13:21:40 +02:00
parent 77c19ff43f
commit 25ef6b37d1
2 changed files with 11 additions and 7 deletions

View File

@@ -2,15 +2,20 @@
export let text: string export let text: string
export let tag: string = 'a' export let tag: string = 'a'
export let url: string = undefined export let url: string = undefined
const classes = [
'button',
$$props.class
].join(' ')
</script> </script>
{#if tag === 'button'} {#if tag === 'button'}
<button class="button {$$props.class}"> <button class={classes}>
<slot /> <slot />
{text} {text}
</button> </button>
{:else if tag === 'a'} {:else if tag === 'a'}
<a href={url} class="button {$$props.class}"> <a href={url} class={classes}>
<slot /> <slot />
<span>{text}</span> <span>{text}</span>
</a> </a>

View File

@@ -1,13 +1,11 @@
.button { .button {
display: inline-flex; display: inline-flex;
height: 48px;
align-items: center; align-items: center;
background: #fff; height: 48px;
padding: 0 24px; padding: 0 24px;
background: #fff;
font: 900 #{rem(18px)}/1 $font-sans;
color: $color-text; color: $color-text;
font-size: rem(18px);
line-height: 1;
font-weight: 700;
border-radius: 100vh; border-radius: 100vh;
border: none; border: none;
text-decoration: none; text-decoration: none;
@@ -22,6 +20,7 @@
// Small // Small
&--small { &--small {
height: 40px; height: 40px;
padding: 0 16px;
} }
// Color Variants // Color Variants