feat: robust navigation tooltips for Firefox/Zen compatibility (#129)

This commit is contained in:
2026-04-04 03:55:58 +05:30
parent 41fb6f95b2
commit 503c2bbd40
2 changed files with 28 additions and 19 deletions
+6
View File
@@ -219,6 +219,12 @@
[data-tip]::before { [data-tip]::before {
@apply ellipsize; @apply ellipsize;
background-color: #1f2937 !important;
color: #f9fafb !important;
}
[data-tip]::after {
border-right-color: #1f2937 !important;
} }
.content-padding-x { .content-padding-x {
+22 -19
View File
@@ -13,32 +13,35 @@
} = $props() } = $props()
const active = $derived($page.url?.pathname?.startsWith(prefix || href || "bogus")) const active = $derived($page.url?.pathname?.startsWith(prefix || href || "bogus"))
const wrapperClass = $derived(
["relative h-14 w-14 p-1", title ? "tooltip tooltip-right" : ""].filter(Boolean).join(" "),
)
const innerClass = $derived(
[
"flex h-full w-full cursor-pointer items-center justify-center rounded-full transition-colors hover:bg-base-300",
restProps.class,
]
.filter(Boolean)
.join(" "),
)
</script> </script>
{#if onclick} <div class={wrapperClass} data-tip={title}>
<Button {onclick} class="relative z-nav-item flex h-14 w-14 items-center justify-center p-1"> {#if onclick}
<div <Button {onclick} class={innerClass}>
class="aspect-square flex-grow cursor-pointer rounded-full {restProps.class} flex items-center justify-center transition-colors hover:bg-base-300"
class:bg-base-300={active}
class:tooltip={title}
data-tip={title}>
{@render children?.()} {@render children?.()}
{#if !active && notification} {#if !active && notification}
<div class="absolute right-1 top-1 h-2 w-2 rounded-full bg-primary"></div> <div class="absolute right-1 top-1 h-2 w-2 rounded-full bg-primary"></div>
{/if} {/if}
</div> </Button>
</Button> {:else}
{:else} <a {href} class={innerClass}>
<a {href} class="relative z-nav-item flex h-14 w-14 items-center justify-center p-1">
<div
class="aspect-square flex-grow cursor-pointer rounded-full {restProps.class} flex items-center justify-center transition-colors hover:bg-base-300"
class:bg-base-300={active}
class:tooltip={title}
data-tip={title}>
{@render children?.()} {@render children?.()}
{#if !active && notification} {#if !active && notification}
<div class="absolute right-1 top-1 h-2 w-2 rounded-full bg-primary"></div> <div class="absolute right-1 top-1 h-2 w-2 rounded-full bg-primary"></div>
{/if} {/if}
</div> </a>
</a> {/if}
{/if} </div>