Skip to content
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

Adjust margin rules for nested blocks. #9735

Merged
merged 1 commit into from
Sep 10, 2018

Conversation

jasmussen
Copy link
Contributor

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.

Before:

screen shot 2018-09-10 at 12 38 17

After:

screen shot 2018-09-10 at 12 33 20

The difference is subtle. But look how the margin between text inside and outside the columns block used to be the same. This is no longer the case, but perhaps worth it as a simplification fix, and then possibly something to revisit separately.

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.
@jasmussen jasmussen added the [Type] Bug An existing feature does not function as intended label Sep 10, 2018
@jasmussen jasmussen self-assigned this Sep 10, 2018
@chrisvanpatten
Copy link
Contributor

Another great one… really loving all these simplifications to the editor CSS!

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@jasmussen jasmussen added this to the 3.9 milestone Sep 10, 2018
@jasmussen jasmussen merged commit aa39621 into master Sep 10, 2018
@jasmussen jasmussen deleted the try/alternate-nested-margins-fix branch September 10, 2018 12:28
jasmussen pushed a commit that referenced this pull request Sep 11, 2018
This PR is a hotfix for a small regression introduced in #9735. Basically the empty "Write your story" placeholder had no top margin, and jumped when clicked. This PR fixes that.
jasmussen added a commit that referenced this pull request Sep 11, 2018
* Fix regression with appender.

This PR is a hotfix for a small regression introduced in #9735. Basically the empty "Write your story" placeholder had no top margin, and jumped when clicked. This PR fixes that.

* Add comments, and fix for inbetween appender also.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Collapsed margins is breaking the reusable blocks border
3 participants