Skip to content

Commit

Permalink
Fix scrolling pos when opening comment with anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
TimDaub committed Dec 2, 2024
1 parent 7ec7bb0 commit 22f30af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/public/news.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
display: none;
}
}
:target {
box-shadow: 0 0 0 2px rgb(175, 192, 70, 0.75);
}
.content-row {
background-color: var(--header-beige);
}
Expand Down
4 changes: 3 additions & 1 deletion src/views/story.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,9 @@ export default async function (trie, theme, index, value, referral) {
(comment) =>
html`<span
id="0x${comment.index}"
style="${comment.flagged
style="${story?.metadata?.image
? "scroll-margin-top: calc(50vw + 100px);"
: "scroll-margin-top: 100px;"} ${comment.flagged
? "opacity: 0.5"
: ""}; color: black; border: var(--border); background-color: var(--background-color0); padding: 0.55rem 0.75rem; border-radius: 2px;display: block; margin-bottom: 15px; white-space: pre-wrap; line-height: 1.3; word-break: break-word; overflow-wrap: break-word;"
>
Expand Down

0 comments on commit 22f30af

Please sign in to comment.