Skip to content

Commit 0d7aeb5

Browse files
style: fix hover state
1 parent 961d1f5 commit 0d7aeb5

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/routes/package/[...package]/SidePanel.svelte

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,25 @@
9191
{/if}
9292
<li class="space-y-2">
9393
{#if packages.length > 1}
94+
<!-- Categories with sub-items -->
9495
<h3 class="text-xl font-bold text-primary">{category.name}</h3>
9596
<ul class="space-y-2">
97+
<!-- Sub-items -->
9698
{#each packages as { pkg } (pkg.name)}
9799
{@const linkedBadgeData = Object.entries(otherReleases).find(
98100
([k]) => k.localeCompare(pkg.name, undefined, { sensitivity: "base" }) === 0
99101
)}
100102
<li>
101103
{#if page.url.pathname.endsWith(`/${pkg.name}`)}
104+
<!-- Active sub-item -->
102105
<span class="font-semibold">{pkg.name}</span>
103106
{:else}
107+
<!-- Clickable sub-items -->
104108
<a
105109
href="/package/{pkg.name}"
106-
class="group inline-flex w-full items-center gap-1 underline-offset-4 hover:underline"
110+
class="group inline-flex w-full items-center gap-1"
107111
>
108-
{pkg.name}
112+
<span class="underline-offset-4 group-hover:underline">{pkg.name}</span>
109113
<span class="ml-auto flex items-center gap-1">
110114
{#if linkedBadgeData}
111115
{@const [, p] = linkedBadgeData}
@@ -123,20 +127,23 @@
123127
{/each}
124128
</ul>
125129
{:else}
130+
<!-- Categories with 1 sub-item -->
126131
{@const firstPackageName = packages[0]?.pkg.name ?? ""}
127132
{@const linkedBadgeData = Object.entries(otherReleases).find(
128133
([k]) => k.localeCompare(firstPackageName, undefined, { sensitivity: "base" }) === 0
129134
)}
130135
{#if page.url.pathname.endsWith(`/${firstPackageName}`)}
136+
<!-- Active category -->
131137
<h3 class="text-xl font-bold text-primary underline underline-offset-4">
132138
{category.name}
133139
</h3>
134140
{:else}
141+
<!-- Clickable category -->
135142
<a
136143
href="/package/{firstPackageName}"
137-
class="group inline-flex w-full items-center gap-1 text-xl font-bold text-primary underline-offset-4 hover:underline"
144+
class="group inline-flex w-full items-center gap-1 text-xl font-bold text-primary"
138145
>
139-
{category.name}
146+
<span class="underline-offset-4 group-hover:underline">{category.name}</span>
140147
<span class="ml-auto flex items-center gap-1">
141148
{#if linkedBadgeData}
142149
{@const [, p] = linkedBadgeData}

0 commit comments

Comments
 (0)