Skip to content
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

Change overflow-x to initial #818

Merged
merged 1 commit into from
May 7, 2019
Merged

Change overflow-x to initial #818

merged 1 commit into from
May 7, 2019

Conversation

StefanieJaeger
Copy link
Contributor

This resolves weird rendering behavior in Chrome and Safari on macOS.


Before

screenshot 2018-11-08 at 20 37 45

After

screenshot 2018-11-08 at 19 18 45

Change overflow-x from auto to initial.
This resolves weird rendering behavior in Chrome and Safari on macOS.

With help from @bash

Co-authored-by: Ruben Schmidmeister <ruben.schmidmeister@icloud.com>
Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to fix the issue for me, tried on a few different browsers.

I would prefer a comment explaining why this is here. I'm not a fan of reverse-engineering convoluted CSS.

The issue here is that the highlight.js theme has a hljs class which sets overflow-x to auto to display horizontal scroll bars when a code block is too wide. mdBook uses hljs for inline code blocks, too, but this auto setting can cause problems. Setting it to initial (which is the default "visible") seems to fix it.

@Dylan-DPC-zz Dylan-DPC-zz merged commit ecfaed1 into rust-lang:master May 7, 2019
@StefanieJaeger StefanieJaeger deleted the overflow-x branch May 8, 2019 14:14
Ruin0x11 pushed a commit to Ruin0x11/mdBook that referenced this pull request Aug 30, 2020
Change overflow-x from auto to initial.
This resolves weird rendering behavior in Chrome and Safari on macOS.

With help from @bash

Co-authored-by: Ruben Schmidmeister <ruben.schmidmeister@icloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants