Skip to content

Commit

Permalink
refactor: different highlighting for sidebar title vs links
Browse files Browse the repository at this point in the history
  • Loading branch information
a-hariti committed Apr 23, 2024
1 parent cce22e9 commit 3390dd1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/dynamicNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,10 @@ export function DynamicNav({
parentNode && !noHeadingLink ? (
<SmartLink
to={`/${root}/`}
className={`${headerClassName} ${path.join('/') === root ? 'active' : ''}`}
className={headerClassName}
activeClassName="active"
data-sidebar-link
data-active-header={isActive}
>
<h6>{title}</h6>
</SmartLink>
Expand Down
8 changes: 7 additions & 1 deletion src/components/sidebar/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@
background-color: var(--accent-purple);
border-radius: 4px;
}

&[data-active-header='true'] {
color: var(--accent-purple);
background-color: var(--accent-purple-light);
opacity: 1;
}
}
}

Expand All @@ -110,7 +116,7 @@
width: 100%;
}

&.active {
&:global(.active) {
background-color: var(--brandDecoration);

h6 {
Expand Down

0 comments on commit 3390dd1

Please sign in to comment.