Skip to content

Commit fae8253

Browse files
committed
docs(navigation-docs): highlight headless or styled properly
1 parent 3734fcc commit fae8253

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

apps/website/src/components/header/header.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,15 @@ export default component$(({ showVersion = false }: HeaderProps) => {
154154
<div class="mr-6 hidden items-center space-x-8 text-sm lg:flex">
155155
<a
156156
class={isDocsActive('/docs/headless/')}
157-
href="/docs/headless/introduction"
157+
href="/docs/headless/introduction/"
158158
>
159159
Headless
160160
</a>
161161
{rootStore.featureFlags?.showStyled && (
162-
<a class={isDocsActive('/docs/styled/')} href="/docs/styled/introduction">
162+
<a
163+
class={isDocsActive('/docs/styled/')}
164+
href="/docs/styled/introduction/"
165+
>
163166
Styled
164167
</a>
165168
)}

apps/website/src/components/navigation-docs/navigation-docs.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ export const DocsNavigation = component$(
5858
<a
5959
class={cn(
6060
'transition-color ease-step hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground rounded-base flex items-center px-4 py-2 text-sm duration-300',
61-
isLinkActive
61+
isLinkActive ||
62+
(location.url.pathname?.startsWith('/docs/headless/') &&
63+
link.name === 'Headless') ||
64+
(location.url.pathname?.startsWith('/docs/styled/') &&
65+
link.name === 'Styled')
6266
? 'bg-accent text-accent-foreground font-bold'
6367
: '',
6468
)}

0 commit comments

Comments
 (0)