split buttons into component and format stuff

This commit is contained in:
2022-08-17 17:08:41 +03:00
parent 71d6a9d9cd
commit 7623aed2bc
3 changed files with 53 additions and 69 deletions

33
src/lib/LinkButton.svelte Normal file
View File

@@ -0,0 +1,33 @@
<script lang="ts">
export let url: string;
export let icon: string;
export let title: string;
export let bg: string;
export let color: string;
</script>
<a href={url} style="background-color: {bg}; color: {color};">
{#if icon}
<div class={icon} />
{/if}
{title}
</a>
<style>
a {
text-decoration: none;
background-color: var(--accent);
padding: 8px 1em 8px 1em;
color: var(--primary);
border-radius: 10px;
transition: filter 0.25s;
display: flex;
align-items: center;
width: fit-content;
gap: 4px;
}
a:hover {
filter: brightness(125%);
}
</style>