fix overlay scrollbars covering one-line scrolled code blocks. fixes #5.
This commit is contained in:
parent
03dcfd05b6
commit
94c1124bd0
2 changed files with 14 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue