Skip to content

Commit

Permalink
Add focus style to sidebar links, show # on focus
Browse files Browse the repository at this point in the history
  • Loading branch information
pacocoursey committed Jul 7, 2020
1 parent 5aac3bd commit 4aeb2a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .nextra/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ function Folder({ item, anchors }) {
}, [active])

return (
<li className={cn(open ? 'active' : '', { 'active-route': active })}>
<li
className={cn('focus:shadow-outline', {
'active-route': active,
active: open
})}
>
<button
onClick={() => {
if (active) return
Expand Down
3 changes: 2 additions & 1 deletion .nextra/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ content li {
width: 1px;
}

.subheading-anchor + a:hover .anchor-icon {
.subheading-anchor + a:hover .anchor-icon,
.subheading-anchor + a:focus .anchor-icon {
opacity: 1;
}
.anchor-icon {
Expand Down

0 comments on commit 4aeb2a2

Please sign in to comment.