mdBook icon indicating copy to clipboard operation
mdBook copied to clipboard

Scrollbars are weird in Safari

Open arniu opened this issue 3 years ago • 5 comments

图片

arniu avatar Mar 08 '21 07:03 arniu

Can you say more what is "weird" about it?

ehuss avatar Mar 08 '21 13:03 ehuss

They are always present in Safari.

arniu avatar Mar 09 '21 09:03 arniu

The scroll bars:

  • Are blocky instead of round
  • Are far wider than normal
  • Have the same background as the main content in the sidebar which looks incredibly janky
  • Do not disappear when not scrolling
  • Displace the context horizontally, messing up the alignment of the page (see red annotations)

Firefox

Screen Shot 2022-12-21 at 5 47 03 PM

Safari

Screen Shot 2022-12-21 at 5 47 14 PM

The visual weirdness of the scrollbars is super janky and off-putting, and this visual glitch is sufficient to make me not want to use mdBook. I'll see if I can make a minimal reproducible example or something later

julianfortune avatar Dec 22 '22 02:12 julianfortune

Screenshot 2022-12-21 at 9 53 48 PM

Yeah, so deleting all the chrome CSS for ::-webkit-scrollbar fixes the issue alright, but also has the effect of making the sidebar scrollbar appear darkened.

julianfortune avatar Dec 22 '22 06:12 julianfortune

I had looked into this problem some time ago and found a solution to thin the scrollbars for the time being, so I sent a PR. However, this PR may not be a complete solution, since it does not turn off the scrollbars when they are not needed.

noritada avatar Dec 22 '22 06:12 noritada

I just noticed the Jekyll theme Just the Docs (with the dark color theme) renders the side bar with a dark scroll bar—it appears this is the expected behavior for scroll areas within a page in Safari and not an issue that needs to be corrected.

just-the-docs-scrollbar

julianfortune avatar Jan 06 '23 20:01 julianfortune

@ehuss Do you have context on why the scrollbar styling was added originally? Thanks

julianfortune avatar Jan 10 '23 23:01 julianfortune

Thanks @ehuss !

julianfortune avatar Jan 29 '23 18:01 julianfortune