Improved overflow-x behavior when styling diffs #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 bothoverflow-x: scroll
andoverflow-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 theexpected
, moved the red arrow into the gutter prior to theactual
, and then added a faint dashed line to help separate the two visually. As theactual
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 actualpre
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:
Where-as previously it would show scrollbars everywhere:
Thanks again for this wonderful test display library!