-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs: fix overflow:auto horizontal scrollbars covering last line of code blocks #37694
Docs: fix overflow:auto horizontal scrollbars covering last line of code blocks #37694
Conversation
to make the hack go through unchallenged
It's not just Firefox - same issue can be seen (though slightly less horrible looking) on macOS / Chrome etc
0a6420a
to
0bf6fb8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need some changes at the least for the homepage hero which looks broken now. I recall there being another solution to this, but can't remember what it is just yet. For now, going to hold off on this.
Annoyingly, there's |
7e9186a
to
fef18c7
Compare
@mdo tweaked the padding values a bit, and nudged the clipboard button slightly ... better? |
fef18c7
to
b4b3481
Compare
b4b3481
to
cf5c706
Compare
Maybe we need |
@XhmikosR that would then make it look a bit odd in browsers that don't do the overlay scrollbar, I'd say Windows/Chrome and arguably even look a bit unbalanced in browsers that DO do the overlay, once you're over it with the mouse Windows/Firefox |
Forcing `overflow: overlay` should normalise behaviour between Chrome/Win and other implementations. While visually the Chrome/Win scrollbar still looks big and ugly, its height/spacing is now taken into account as being part of the content, so styles can be applied consistently with extra padding at the bottom
@mdo made some futher tweaks, particularly by adding Before/after comparison in Chrome/WindowsHero masthead (virtually the same) Further down on the homepage - install / CDN Before/after comparison in Firefox/WindowsHero masthead (virtually the same) Further down on the homepage - install / CDN |
…ttps://github.com/twbs/bootstrap into patrickhlauke-docs-firefox-overflow-auto-workaround
related: this problem should be fixed directly in reboot, but that'd be a breaking change ... added a new issue for v6 #37909 |
@mdo any more thoughts on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, couple tweaks that I'll commit and then merge. Thanks for all the detail and follow through here!
Description
Some browsers (Firefox in recent builds on Windows, and browsers on macOS) have changed how they handles scrollbars when a container uses
overflow: auto
. Scrollbars don't show at all at first. When hovering over the container, a thin sliver of a scrollbar appears. When hovering over the thin scrollbar, it expands to a full fat scrollbar.Unfortunately, the browsers then don't leave any extra space for the full fat scrollbar to appear. As a result, currently horizontal scrollbars cover the last line of code in our documentation code blocks.
Chrome/macOS
Fixefox/Windows
With this fix, we just add some extra top/bottom padding to code blocks, leaving enough space for the scrollbars that then appear.
Only downside is that in some browsers (e.g. Chrome/Windows) those code blocks now have slightly more unnecessary padding (since these browsers already reserve space for the always visible scrollbar)
Chrome/Windows
Type of changes
Checklist
npm run lint
)Live previews
https://deploy-preview-37694--twbs-bootstrap.netlify.app/docs/5.2/getting-started/introduction/