fix overlay scrollbars covering one-line scrolled code blocks. fixes #5.

This commit is contained in:
Alex Grintsvayg 2019-01-24 16:08:31 -05:00
parent 03dcfd05b6
commit 94c1124bd0
No known key found for this signature in database
GPG key ID: AEB3F089F86A22B5
2 changed files with 14 additions and 1 deletions

View file

@ -79,6 +79,12 @@
toggleClass(document.querySelector('.toc'), "open");
});
document.querySelectorAll('pre').forEach((e) => {
if (e.scrollWidth > e.clientWidth /* && e.clientHeight < 30*/) {
toggleClass(e, "has-scroll");
}
});
// need this part to fix toc offset height if content above toc changes height
var resizeTimer;

View file

@ -210,4 +210,11 @@ dt {
}
dd + dt {
margin-top: 10px;
}
}
/* add padding to compensate for overlay scrollbars on mac.*/
/* overlay scrollbars on one-line-high code blocks hide the code */
/* ideally id only target mac but idk how */
.has-scroll {
padding-bottom: 13px;
}