Adds option to control code sample overflow styles #68
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.
What does this PR cover?
By default, code samples are styled so that any overflow on the y-axis is hidden but the x-axis always shows the scrollbar even if it isn't necessary. This can be seen in the first screenshot pasted below, and in my opinion it's not the cleanest of styles.
I changed the default style to be
overflow: auto;
for both axes. Now, if scrolling is unneeded, it won't show. See the second screenshot.I also added an option to
data.json
to allow users to customize this behavior.How can this be tested?
Serve the master branch and inspect any code block. Serve my branch to see the difference. You can customize my branch's behavior by changing the
theme.code_overflow
option indata.json
to any valid value for theoverflow
CSS property. An invalid value will fall back to the defaults as defined in the app's CSS file.Screenshots / Screencast
before:
after:
Reviewers
Review 1
By adding a +1 you are confirming you have...
overflow: auto;
by defaultcode_overflow
to theme object indata.json
code_overflow
prop to style overrides inindex.html