-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Try uncollapsing margins on the columns block. #8283
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would
0.1px
be a better value here? While it's not valid in the sense of a fraction of a pixel, it achieves the same effect while not having a visual difference (since it will round to0
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review, forgot to mention that before.
A better solution might exist in the process outlined below: #8283 (comment)
I pushed a fix to use the 0.1px as you suggested. Because although it had visual side effects on the Classic Block toolbar on retina screens (the rounding math glitched out every once in a while causing flickering when scrolling), it doesn't appear to have any side effects here.
However a different approach is to simply accept that flex containers margins do not collapse and stop compensating for it. That is — we don't need to prevent the parent block margins from collapsing (can remove the padding hack), but we also remove these two lines:
https://github.com/WordPress/gutenberg/blob/master/packages/editor/src/components/block-list/style.scss#L130
The net result is this:
GIF:
As you can see the margins on paragraphs inside are now doubled before and after, because we don't compensate. We probably want to do this as part of #8283 (comment), depending on what you think of that.