feat: new link design

This commit is contained in:
Xyphyn committed 2023-08-17 15:47:09 -07:00
1 parent f3fc1adf90
commit c936e96f75
3 files changed
+29 -20

No files matched your search

+21 -7
View File
@@ -1,14 +1,28 @@
<script lang="ts">
export let href: string
export let highlight: boolean = false
export let nowrap: boolean = false
$: url = new URL(href)
</script>
<a
{href}
class="{highlight ? 'text-sky-500' : ''} hover:underline"
{...$$restProps}
>
<a {href} class="{highlight ? 'text-blue-500' : ''} hover:underline max-w-full">
<slot name="icon" />
<slot />
<slot>
<span
class="flex gap-0 {nowrap
? 'w-full whitespace-nowrap overflow-hidden text-ellipsis text-xs'
: ''} {$$props.class}"
>
<span class="opacity-90">
{url.protocol}//
</span>
<span class="font-bold">
{url.hostname}
</span>
<span class="opacity-90">
{url.pathname}
</span>
</span>
</slot>
</a>