-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[WIP] Block Support: Add gap block support feature #32571
[WIP] Block Support: Add gap block support feature #32571
Conversation
This is really cool, thanks for sharing!
It would be great if you could provide some testing instructions to reproduce these bugs; I'd like to fiddle around and help finding the solution. |
Thanks @vcanales, appreciate you taking an early look! This is very much an early WIP at the moment, but I've updated the testing instructions, hopefully that'll get you up an running. This PR depends on and was forked from #32392. I discovered while working on this that the BoxControl component in its current state doesn't quite meet our needs for the Gap support, because when the control is unlinked, when dealing with CSS Gap, we want to group together vertical and horizontal values and controls. Today, I took at look separately at adding support for that in the BoxControl component over in this PR: #32610 I'm wrapping up for the week, but hope to get back to this PR on Tuesday. In its current form, I just got the CSS property name construction working in I'm very happy for feedback of course, and please do leave any comments if there's a particular way you think this would be best implemented. 🙂 |
Thank you so much for updating the instructions! I understand the early status — I've recently worked on a few of those cool ideas that require a lot of tinkering to come to fruition. I'd like to approach this testing by using your proposed changes as a platform, so I'm not looking to nitpick or alter your current work, and rather "forking" it to look for stuff we might consider exploring. Thanks again! |
f140452
to
01cf433
Compare
4726898
to
2cf8fc6
Compare
b63b4e6
to
7c988d6
Compare
ea98a10
to
dbaa31c
Compare
fd663e4
to
5484b58
Compare
I've just given this a manual rebase and adjusted a couple of things to get it compatible with the latest changes in #32392 It also now uses the Still more to do (and I haven't looked at global styles yet), but this should now get this PR back in a mostly working state. |
ddce66f
to
61a27ac
Compare
…left values from row/column style values
61a27ac
to
69ba2b9
Compare
I've updated this PR to add in global styles support, so it should be testable now to roughly cover the main areas that would be addressed by a gap support. The work here might wind up being superseded by #33812, which has a more general solution for controlling gaps between blocks. I've added a comment over in that PR referencing this one: #33812 (comment) CC: @youknowriad just pinging you here — this is my WIP exploring a gap support. I imagine we'll likely want to go with your PR instead (as the approach is more tied to layouts) and then iterate from there? |
Update: as discussed in #33812 (comment), I'll explore swapping out the inline One of the big benefits of using CSS variables will be that we can defer to each block for working out how we want to use the value — whether we're ready to use CSS |
I've updated this PR with a pass exploring using CSS variables instead of gap attributes directly. I think this will offer a lot more flexibility, but there are still some issues to address. I've added in the following CSS variables:
I think these should be consolidated if possible, it's a little unwieldy having separate values and attempting to keep them in sync. However, it would still be good for blocks to be able to use separate row/column (or horizontal/vertical) values. I've also updated the PR description with instructions on how to test using the Buttons block, by adding a couple of CSS rules. Still to be done: I need to update some of the naming to keep this PR consistent (e.g. rename the gap support to blockGap). |
I know this is still WIP, but this is looking great! I tested gap as well as the separated row/column gaps via:
Pointing out just in case for others testing: there's a little bit of extra top/bottom margin being applied to individual Button blocks in the button styles, which could easily be removed when the support is added to Buttons 'officially' so that the row-gap is solely responsible for managing the space between rows. |
Now that the Dimensions Panel PR has been merged (#32392), it looks like I'll need to open up a new PR to base this off trunk. I'll add a link when the new PR is up. |
Update: I have moved the changes from this PR over to #33991, which is based off trunk. I'll continue work over on that PR. |
* Add gap block support feature based on #32571 * Server-render the gap block support, and skip serialization on save in the editor * Add PHP tests for spacing gap support server-side rendering * Rename support from customBlockGap to blockGap * Align whitespace
Update (2021-08-11): Now that the ToolsPanel (#32392) has been merged, the work from this PR has moved over to #33991.