doersino / markdeep-slides

Build presentation slides with Markdeep and present them right in your browser.
https://doersino.github.io/markdeep-slides/demo.md.html
BSD 2-Clause "Simplified" License
172 stars 13 forks source link

Fix incorrect slide dimensions when "old-style" scroll bars are enabled #23

Closed doersino closed 4 years ago

doersino commented 4 years ago

As mentioned by @dirkk0 in #22.

Turns out that when scroll bars are set to always be visible and thus take up space (or the user is on an OS that always shows scroll bars), the slides aren't sized properly. This is bad because:

I didn't notice this during development because I'm using macOS on a laptop, where scroll bars are overlaid onto the content only when scrolling and don't interfere with the viewport.

I'll try to address this soon.

dirkk0 commented 4 years ago

thx!!

doersino commented 4 years ago

Fixed – better late than never. This took some work (& testing) because I was relying on the vw and vh CSS units for sizing, and they include the scroll bars, which is objectively dumb (I cannot come up with any advantages of this definition, anyway).

So instead, I'm now using JS to compute the "proper" vw and vh values, as variables --vw and --wh, on

and use those variables wherever I was previously using the built-in units, which feels so wrong but appears to work. (This convoluted approach is necessary because scroll bars are not the same width across all platforms.)

Thanks again for bringing this to my attention!