Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Commit b86f4cf

Browse files
author
dpatanin
committed
add active Link behaviour to sidebar
1 parent 329fe70 commit b86f4cf

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/scss/components/_sidebar.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ span {
7272
overflow-y: auto;
7373
color: $white;
7474
//Instead of the line below you could use @include transition($transition-1, $transition-2, $transition-3, $transition-4, $transition-5, $transition-6, $transition-7, $transition-8, $transition-9, $transition-10)
75-
transition: all 0.3s;
75+
transition: all 0.3s;
76+
.active-Link {
77+
color: $white;
78+
background: $highlight;
79+
}
7680
&.active {
7781
min-width: 10px;
7882
max-width: 10px;

src/templates/scanner.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ const Scanner = ({ data }) => {
1414
<ul class="list-unstyled components">
1515
{scanner.map(scanner => (
1616
<li>
17-
<Link to={scanner.node.frontmatter.path}>
17+
<Link
18+
to={scanner.node.frontmatter.path}
19+
activeClassName="active-Link"
20+
>
1821
{scanner.node.frontmatter.title}
1922
</Link>
2023
</li>

0 commit comments

Comments
 (0)