Skip to content

Commit 206fd2b

Browse files
committed
fix: refactor sidebar item definition for improved readability
1 parent 0525430 commit 206fd2b

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

packages/nimiq-vitepress-theme/src/layout/Sidebar.vue

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ function openAccordionInitialState(items: NimiqVitepressSidebar['items'][number]
5656
</p>
5757
</component>
5858
</DefineNavItem>
59-
6059
<CollapsibleRoot v-model:open="submoduleNavigatorOpen" w-full f-mt-sm>
6160
<CollapsibleTrigger bg-transparent w-full relative group ring="1.5 neutral-400" rounded="6 reka-open:b-0" transition-border-radius of-clip>
6261
<NavItem :item="currentDocModule" component="div" />
@@ -69,18 +68,17 @@ function openAccordionInitialState(items: NimiqVitepressSidebar['items'][number]
6968
</div>
7069
</CollapsibleContent>
7170
</CollapsibleRoot>
72-
73-
<DefineSidebarItem v-slot="{ item: { text, link, icon } }">
74-
<a :href="withBase(link!)" class="sidebar-item" :data-state="isActive(page.relativePath, link) ? 'active' : ''" data-active:font-bold transition-all data-active:text-blue data-active:bg-blue-400 group :class="{ 'nq-arrow after:op-70 hocus:after:op-100': isExternalLink(link!) }" transition-opacity :target="isExternalLink(link!) ? '_blank' : undefined">
75-
<div v-if="isActive(page.relativePath, link)" aria-hidden absolute inset-y-0 bg-blue op-70 rounded-full w-2 z-2 transition-colors left="0 [[data-state=open]_&]:12" />
76-
<div v-if="icon" :class="icon" f-text-sm text="neutral data-active:blue" op="70 group-hocus:100" transition-opacity mr-8 shrink-0 />
77-
<span flex-1>{{ text }}</span>
78-
</a>
79-
</DefineSidebarItem>
8071
</div>
8172

8273
<hr w-full h-1.5 bg-neutral-200 f-mt-xs>
8374

75+
<DefineSidebarItem v-slot="{ item: { text, link, icon } }">
76+
<a :href="withBase(link!)" class="sidebar-item" :data-state="isActive(page.relativePath, link) ? 'active' : ''" data-active:font-bold transition-all data-active:text-blue data-active:bg-blue-400 group :class="{ 'nq-arrow after:op-70 hocus:after:op-100': isExternalLink(link!) }" transition-opacity :target="isExternalLink(link!) ? '_blank' : undefined">
77+
<div v-if="isActive(page.relativePath, link)" aria-hidden absolute inset-y-0 bg-blue op-70 rounded-full w-2 z-2 transition-colors left="0 [[data-state=open]_&]:12" />
78+
<div v-if="icon" :class="icon" f-text-sm text="neutral data-active:blue" op="70 group-hocus:100" transition-opacity mr-8 shrink-0 />
79+
<span flex-1>{{ text }}</span>
80+
</a>
81+
</DefineSidebarItem>
8482
<ScrollAreaRoot relative of-hidden bg-neutral-100 var:scrollbar-size:10px as="nav" flex-1 f-px-xs v-bind="$attrs">
8583
<div absolute top-0 z-2 w-full h-24 bg-gradient="to-t from-transparent to-neutral-100" />
8684
<ScrollAreaViewport size-full f-pt-xs as="ul">

0 commit comments

Comments
 (0)