1
0
Fork 0
mirror of https://github.com/mat-1/matdoesdev.git synced 2025-08-02 23:44:39 +00:00
matdoesdev/src/lib/Icon/Icon.svelte
2024-10-25 23:53:27 +00:00

29 lines
476 B
Svelte

<script lang="ts">
interface Props {
children?: import('svelte').Snippet;
}
let { children }: Props = $props();
export const alt: string | undefined = undefined
</script>
<span class="icon" aria-label={alt}>
{@render children?.()}
</span>
<style>
.icon {
height: 1em;
width: 1em;
opacity: 0.5;
transition: opacity 200ms;
display: block;
}
.icon :global(img) {
display: block;
margin: 0 auto;
}
:global(a) .icon:hover {
opacity: 0.9;
}
</style>