boredgame/src/lib/components/LinkWithIcon.svelte

23 lines
484 B
Svelte
Raw Normal View History

<script lang="ts">
const { url, ariaLabel = `Link to ${url}`, external = false, children }: { url: string; ariaLabel?: string; external?: boolean; children: any } = $props();
</script>
<a
href={url}
target={external ? '_blank' : '_self'}
rel="noreferrer"
aria-label={`Board Game Atlas Link for ${ariaLabel}`}
>
{@render children()}
</a>
<style>
a {
display: grid;
grid-template-columns: repeat(2, auto);
place-items: center;
2023-01-08 00:12:55 +00:00
gap: 0.25rem;
2023-01-14 06:54:28 +00:00
margin: 1rem;
}
</style>