-
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
Collapsed margins is breaking the reusable blocks border #9730
Comments
Are there any additional steps? I can't reproduce: Note that although collapsing margins could definitely cause this, until such a time as we decide to move forward with #8350, that PR should not have affected margins. Yes, it enabled margin collapsing, but it also compensated for those collapsing margins to ensure there wasn't any visual change. "Why then?" you might ask? Well because now we can allow margins to collapse on a per-block basis, which is a useful tool for themers who want their editor styles to look as closely as possible to the end result. |
I guess it is surfaced in #9732 I thought it was a generic error happening for every reusable block but it only happens for reusable blocks with InnerBlocks usage (columns or multi-selection) |
I found out why this is. We apply negative margins to any block that contains a |
This PR one one hand fixes #9730, and on the other hand simplifies some of the column wrangling code to be simpler. It does visualy regress it slightly: previously we'd use negative margins to make it so text inside columns looked to be spaced the same as text before and after the columns. However this greatly complexified the CSS, which caused #9730 in the first place. The thing is — the columns block itself has a margin. This margin collapses correctly to adjacent blocks. But given it also has children, those margins don't also collapse. Possibly we could make this happen, I'm unsure, flex containers are supposed to prevent margin collapsing by creating their own contexts, but it seems like the negative margins added complexity where it wasn't helpful.
Pushed a fix. That will fix it for #9732 as well, but good to have separate for now. |
This PR one one hand fixes #9730, and on the other hand simplifies some of the column wrangling code to be simpler. It does visualy regress it slightly: previously we'd use negative margins to make it so text inside columns looked to be spaced the same as text before and after the columns. However this greatly complexified the CSS, which caused #9730 in the first place. The thing is — the columns block itself has a margin. This margin collapses correctly to adjacent blocks. But given it also has children, those margins don't also collapse. Possibly we could make this happen, I'm unsure, flex containers are supposed to prevent margin collapsing by creating their own contexts, but it seems like the negative margins added complexity where it wasn't helpful.
Use two sequential reusable blocks in a post and notice that their borders are not spaced properly. It's probably a regression of the margin-collapsing PR
cc @jasmussen
The text was updated successfully, but these errors were encountered: