feat: Use icon library instead of SVGs (#271)

This commit is contained in:
madkärma
2024-12-21 19:22:13 +01:00
committed by GitHub
parent b068c38661
commit f73f54a926
30 changed files with 118 additions and 139 deletions

View File

@@ -1,23 +1,16 @@
<script lang="ts">
export let type: 'filled' | 'tonal' | 'text' | 'outlined';
export let icon = '';
export let href = '';
export let target = '';
export let label = '';
export let href: string = '';
export let target: string = '';
export let label: string = '';
</script>
{#if href}
<a {href} {target} class={`button-${type}`} aria-label={label}>
{#if icon}
<img src="../icons/{icon}.svg" alt={icon} />
{/if}
<slot />
</a>
{:else}
<button on:click class={`button-${type}`} aria-label={label}>
{#if icon}
<img src="../icons/{icon}.svg" alt={icon} />
{/if}
<slot />
</button>
{/if}
@@ -74,8 +67,4 @@
a:hover {
filter: brightness(85%);
}
img {
height: 20px;
}
</style>