Skip to content

Commit

Permalink
feat: scroll active outline marker into view on activation
Browse files Browse the repository at this point in the history
  • Loading branch information
BobbieGoede committed Mar 13, 2024
1 parent 11a7696 commit eb7498b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/client/theme-default/composables/outline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export function useActiveAnchor(

if (activeLink) {
activeLink.classList.add('active')
activeLink.scrollIntoView({ behavior: 'smooth', block: 'center' })
marker.value.style.top = activeLink.offsetTop + 39 + 'px'
marker.value.style.opacity = '1'
} else {
Expand Down

0 comments on commit eb7498b

Please sign in to comment.