Skip to content

Commit 493b951

Browse files
author
rishab
committed
Highlight or add left border to active navbar subitem
1 parent 7b7bad5 commit 493b951

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/components/Sidebar.module.css

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
flex-grow: 1;
5151
position: relative;
5252
overflow-y: auto;
53+
padding-top: 1rem;
5354
& ul li h4 {
5455
text-wrap: pretty;
5556
}
@@ -110,20 +111,29 @@
110111
}
111112

112113
.tocItem {
114+
margin-bottom: 1rem;
115+
padding-left: calc(var(--gutter) + 0.5rem);
116+
113117
& a {
114118
font-family: var(--font);
115119
text-overflow: ellipsis;
116120
color: var(--processing-blue-dark);
121+
border-left: 4px solid transparent;
122+
display: flex;
123+
align-items: center;
124+
padding: 3px 0.75rem;
125+
transition: color 0.3s, border-left-color 0.3s;
126+
117127
&:hover {
118128
color: var(--processing-blue-mid);
129+
border-left-color: var(--processing-blue-mid);
119130
}
131+
120132
}
121133

122134
& h4 {
123135
font-size: var(--text-regular);
124136
color: inherit;
125-
&:hover {
126-
color: inherit;
127-
}
137+
margin: 0;
128138
}
129139
}

0 commit comments

Comments
 (0)