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

fix code breaks along x axis #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix code breaks along x axis #12

wants to merge 1 commit into from

Conversation

ejmg
Copy link
Owner

@ejmg ejmg commented Jan 31, 2021

addresses issue #11 by adding overflow-x: scroll to the formatting of codeblocks under pre in _main.scss

@vercel
Copy link

vercel bot commented Jan 31, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/ejmg/zerm/qxiox6x27
✅ Preview: https://zerm-git-overflow-x.ejmg.vercel.app

@ebkalderon
Copy link
Contributor

ebkalderon commented Feb 2, 2021

This fix doesn't seem to work in practice, sadly. After consulting Inspect ElementResponsive Design Mode in Firefox, I see that the overflow-x: scroll CSS property doesn't get applied because _main.scss:188 applies white-space: pre-wrap on the outer pre tag on small screens, which prevents the code blocks from scrolling.

If I uncheck the white-space: pre-wrap property of the pre tag in Inspect Element to disable it, I get the correct scrolling behavior. Disabling word-wrap: break-word doesn't seem to have any effect on the scrolling.

After playing around with this branch a bit, I think a more general solution to #11 would be to:

  1. Use overflow-x: auto instead of scroll, to ensure on all browsers that the scrollbar only appears if the content overflows (source).
  2. Remove _main.scss:188 (possibly consider removing the entire @media query at _main.scss:187-190, since we aren't text-wrapping pre and code tags anymore).

What do you think about this, @ejmg? Does this work for you, or do you have an alternative solution?

@ejmg
Copy link
Owner Author

ejmg commented Jul 17, 2021

wew, it's been a while since touching this. that seems reasonable as a fix. i'm currently trying to work through the backlog of PR's and will try coming back to this one soon after the rest.

@ebkalderon
Copy link
Contributor

ebkalderon commented Nov 15, 2022

Any luck with this? I'd still like to see #12 (comment) land in mainline someday, since code blocks are still broken on mobile devices with this theme.

@ejmg
Copy link
Owner Author

ejmg commented Nov 15, 2022 via email

@ebkalderon
Copy link
Contributor

That would be wonderful! Thank you so much, @ejmg. It would be wonderful to get a few of these quality-of-life fixes in soon, but feel free to take as much time as you need.

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.

2 participants