-
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
Gallery: Opt-in to axial (column/row) block spacing controls #41175
Conversation
This is working well for block themes 🎉 in both the editor and the frontend For classic themes I'm seeing that the layout Where have we see that before 😄 ? In classic themes I'm seeing this in the footer: <style> .wp-block-gallery-2{ --wp--style--unstable-gallery-gap: 154px; gap: 208px 154px}</style><style>.wp-container-3 {display: flex;gap: 0.5em;flex-wrap: wrap;align-items: center;}.wp-container-3 > * { margin: 0; }</style> For block themes, the layout styles are in the header, but the gallery gap css is in the footer, so it overwrites Maybe something to test further in #41015 too @glendaviesnz |
Oh, I forgot to ask whether it matters since classic themes might not opt-in to blockGap in general anyway? Might affect copy/pasted block content though. |
Thanks for testing!
I think I'd lean toward it not really mattering too much for classic themes because they can't opt-in to |
This is the same on trunk at the moment, ie. if you add a gallery to a block theme and set the gap, then switch to a non-block theme, the gap on frontend reverts back to the 0.5em gap default ... so I don't think we need to worry about it as part of this PR. |
I wonder if there are any implications with |
In the longer-term, ideally yes, it'd be great to be able to set default values there (particularly when we come up with a solution for #39789 where we could do it at the gallery level within |
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.
Tested well for me. Worked as expected for block themes, and non-block themes continued to fall back to the gap default.
Thanks Glen! Since it's nearly the end of the week for me, just to be safe, I'll leave this open until Monday and merge then if there aren't any objections. |
…p-tests-config * 'trunk' of github.com:WordPress/gutenberg: (88 commits) Components: refactor `AlignmentMatrixControl` to pass `exhaustive-deps` (#41167) [RNMobile] Add 'Insert from URL' option to Image block (#40334) [RNMobile] Improvements to Getting Started Guides (#40964) Post Author Name: Add to and from Post Author transformations (#41151) CheckboxControl: Add unit tests (#41165) Improve inline documentation (#41209) Mobile Release v1.76.1 (#41196) Use explicit type definitions for entity configuration (#40995) Scripts: Convert file extension to js in `block.json` during build (#41068) Reflects revert in 6446878 (#41221) get_style_nodes should be compatible with parent method. (#41217) Gallery: Opt-in to axial (column/row) block spacing controls (#41175) Table of Contents block: convert line breaks to spaces in headings. (#41206) Add support for button elements to theme.json (#40260) Global Styles: Load block CSS conditionally (#41160) Update URL (#41188) Improve autocompleter performance (#41197) Site Editor: Set min-width for styles preview (#41198) Remove Navigation Editor screen from experiments page (#40878) Fix broken Page title for pages created inline within in Nav block (#41063) ...
What?
Fixes: #41174
This PR opts-in to separate column / row (or horizontal / vertical) controls for the spacing between images in the Gallery block. This unlocks layouts like the following, where depending on the design, folks might like to have a different horizontal versus vertical gap between images:
Why?
In #41125 we added in the technical capability for the gallery block to support split horizontal / vertical values. That PR was merged primarily as a bug fix — this PR now opts-in to the controls so that the feature is available in the UI.
How?
block.json
file.Testing Instructions
spacing.blockGap
, go to add a gallery block and add a few images.Screenshots or screencast