From 4103f53f2a7a350c951f74ec607735e33a415b4f Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 19 Oct 2020 23:07:37 -0700 Subject: [PATCH] fix: Offset headers when scrolling from TOC to account for fixed header closes #1578 --- app/components/Editor.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/components/Editor.js b/app/components/Editor.js index ef998c10e..4e66a649b 100644 --- a/app/components/Editor.js +++ b/app/components/Editor.js @@ -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};