Add margin top to certain single elements surrounded by code blocks for consistency #1128
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 change? What problem does it solve?
Take this structure:
The current post-single CSS adds margin to the bottom of the paragraph and that's it. This works great when the previous element also got the same amount of bottom margin, however code blocks do not! The end result looks similar to the figure above.
This commit fixes this adding top margin to elements that come immediately after a code block (they have the .highlight class). The amount of top margin added is the same they already get on the bottom.
Before (notice that elements between the codeblocks appear closer to the previous code block than the next1)
After
I left definition lists alone because they lack any margin at all so adding some margin top would be inconsistent.
Was the change discussed in an issue or in the Discussions before?
Nope. My apologies if this is bad form on my part!
PR Checklist
Footnotes
Except for ordered lists, my user agent spreadsheets apparently already "fixes" this problem adding enough margin top. ↩