Skip to content

Commit

Permalink
fix(ui): fix anchor scroll from bottom to top
Browse files Browse the repository at this point in the history
  • Loading branch information
matschik committed Mar 2, 2024
1 parent 8118ca9 commit 06f890a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,13 @@
{#each snippets.filter((s) => s.sectionId === section.sectionId) as snippet}
<div
id={section.sectionId + "." + snippet.snippetId}
data-snippet-id={section.sectionId +
"." +
snippet.snippetId}
>
<!-- bg-[var(--bg-color)] -->
<h2
id={snippet.snippetId}
class="header-anchor sticky py-2 top-[2.9531rem] z-10 bg-[var(--bg-color)]"
>
{snippet.title}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Aside.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
{#each snippets.filter((s) => s.sectionId === section.sectionId) as snippet}
<li>
<a
href={`#${snippet.snippetId}`}
href={`#${section.sectionId + "." + snippet.snippetId}`}
class={c(
"inline-block w-full py-1.5 px-4 text-white hover:bg-gray-800 rounded hover:opacity-100 transition-opacity",
section.sectionId + "." + snippet.snippetId ===
Expand Down

0 comments on commit 06f890a

Please sign in to comment.