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

Improved overflow-x behavior when styling diffs #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dgtized
Copy link

@dgtized dgtized commented Jul 15, 2022

Minor change in diff styling that I found to be more readable, but appreciate this is an aesthetic change so may not be your cup of tea.

The overflow issue may be specific to Chrome on Linux, but it looks like for Chrome every pre has a scrollbar. This does not appear to be the case for Firefox, but in Firefox both overflow-x: scroll and overflow-x: auto appear to result in the same visual behavior, where the overflow scrollbar is conditional. I've added one failing test example with overflow to help demonstrate the styling issue.

The other styling change is I lined up the actual result with the expected, moved the red arrow into the gutter prior to the actual, and then added a faint dashed line to help separate the two visually. As the actual result can sometimes scroll, it's nice to avoid indenting it with the arrow to ensure we get most of the available width. I think I'm also just partial to the expected and actual pre blocks lining up. I'm happy to back out the arrow/dashed line change as I think the overflow issue is the more annoying problem, but thought I would at least see if the new style was appreciated first.

The new styling looks like:
image

Where-as previously it would show scrollbars everywhere:
image

Thanks again for this wonderful test display library!

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.

1 participant