Improve markdown TOC scrolling (#349)

Use a better system for scrolling using scrollTo on the
OverlayScrollbars ref. This lets me get the heading as close to the top
of the viewport as possible without the convoluted CSS tricks I was
trying before.
This commit is contained in:
Evan Simkowitz
2024-09-06 15:11:46 -07:00
committed by GitHub
parent f07ac79b0b
commit 9f5ccddad2
2 changed files with 32 additions and 35 deletions
-2
View File
@@ -17,7 +17,6 @@
font-size: 14px;
overflow-wrap: break-word;
margin-bottom: 10px;
--half-contents-height: 10em;
.heading {
&:first-of-type {
@@ -26,7 +25,6 @@
color: var(--app-text-color);
margin-top: 16px;
margin-bottom: 8px;
scroll-margin-block-end: var(--half-contents-height);
}
strong {