-
Notifications
You must be signed in to change notification settings - Fork 18
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
Layout Grid: Fix vertical alignment, round 2 #254
Conversation
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.
Nice work @jasmussen, that's done the trick!
This is working nicely for me in the post and site editors, and on the front end. Top vertical alignment stretches the full height of the container, and middle and bottom alignment just to the height of the content:
I haven't been able to fault it on my test site, so LGTM! Just left a couple of tiny notes about whitespace in the style.scss
diff 🙂
blocks/layout-grid/style.scss
Outdated
@@ -168,7 +168,8 @@ | |||
/** | |||
* Parent column alignment | |||
*/ | |||
.wp-block-jetpack-layout-grid { | |||
|
|||
.wp-block-jetpack-layout-grid { |
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.
Tiniest of tiny nits: there's added whitespace at the beginning of this line
blocks/layout-grid/style.scss
Outdated
@@ -185,9 +186,12 @@ | |||
/** | |||
* Individual column alignment | |||
*/ | |||
.wp-block-jetpack-layout-grid-column { | |||
|
|||
.wp-block-jetpack-layout-grid-column { |
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.
Tiniest of tiny nits: there's added whitespace at the beginning of this line
Your review was excellent, thanks so much. I'll try and keep an eye on any feedback around the columns not being full-height when vertically aligned; but since that's arguably been entirely broken until now, I don't expect a ton. I'll land this one, look at another quick fix, and then hopefully we can make a release. Thanks again. |
Alternative to #252. Fixes #250. A few things going on:
Together these present a bit of a challenge; if we wanted a full height colored background for a column with text bottom aligned, then it would have to be a flex container, as #252 does. But that breaks margin collapsing.
It seems we've supported full height columns, but never for an alignment other than top (please correct me if I'm wrong). And so the smaller fix in this PR adjusts the rules for that to match, and cleans things up a bit.
Site editor before (vertical alignments didn't work):
![Screenshot 2021-12-16 at 12 12 20](https://user-images.githubusercontent.com/1204802/146361449-1756d895-c525-4f82-a9d4-7b33519d62da.png)
Site editor after (vertical alignments work, and columns are full height when top aligned):
Post editor and frontend also work the same:
![Screenshot 2021-12-16 at 12 07 52](https://user-images.githubusercontent.com/1204802/146361551-8d26f6e7-40e5-44bd-83ba-d025e2642fe0.png)
![Screenshot 2021-12-16 at 12 07 58](https://user-images.githubusercontent.com/1204802/146361558-ffa9e8cc-68d8-4c61-8934-007f84959ac9.png)
In fixing this, I've noticed a few regressions with the appender and the inspector which I'll follow up on separately.