feat: new link design
This commit is contained in:
1 parent
f3fc1adf90
commit
c936e96f75
3 files changed
+29
-20
No files matched your search
@@ -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>
|
||||
Reference in new issue
Block a user