Skip to content

Commit

Permalink
fix: Offset headers when scrolling from TOC to account for fixed header
Browse files Browse the repository at this point in the history
  • Loading branch information
tommoor authored and japsu committed Oct 30, 2020
1 parent 462da44 commit 1059dec
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/components/Editor.js
Expand Up @@ -101,6 +101,15 @@ const StyledEditor = styled(RichMarkdownEditor)`
cursor: default;
}
/* pseudo element allows us to add spacing for fixed header */
/* ref: https://stackoverflow.com/a/28824157 */
.heading-name::before {
content: "";
display: block;
height: 72px;
margin: -72px 0 0;
}
p {
a {
color: ${(props) => props.theme.text};
Expand Down

0 comments on commit 1059dec

Please sign in to comment.