diff --git a/_layouts/spec.html b/_layouts/spec.html index 4ade375..ea45459 100644 --- a/_layouts/spec.html +++ b/_layouts/spec.html @@ -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; diff --git a/assets/style.css b/assets/style.css index 480c858..07563b6 100644 --- a/assets/style.css +++ b/assets/style.css @@ -210,4 +210,11 @@ dt { } dd + dt { margin-top: 10px; -} \ No newline at end of file +} + +/* 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; +}