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

[WIP] Post Template: Try adding flex layout and block spacing support #48340

Conversation

andrewserong
Copy link
Contributor

@andrewserong andrewserong commented Feb 23, 2023

What?

🚧 🚧 🚧 🚧 This is an experimental WIP PR and currently does not work! 🚧 🚧 🚧 🚧

This PR seeks to explore some of the issues that will need to be resolved in order to support block spacing in the post template block. The longer-term goal is to come up with a fix for #44557

Why?

The Post Template block is a very useful and frequently used block for laying out a list of posts, and it'll likely be very beneficial to have more control over how it's displayed, along with its positioning and spacing.

How?

Try opting the Post Template block into flex layout and opt-in to block spacing

Testing Instructions

TBC

Tasks

  • The Query Loop block currently passes down the ad-hoc layout type. Can we get the local layout type of the Post Template block to override this, and as a result, workaround some of the backcompat issues with introducing flex layout here?
  • How can we allow switching between Flex and Flow/Constrained in an intuitive way? The layout switcher component at the moment isn't very user friendly
  • How do we deal with the default 1.25em gap value, and allow themes / editors to override this value without breaking anything?
  • How do we add in vertical alignment controls with a safe default?

Testing Instructions for Keyboard

Screenshots or screencast

It's pretty broken, but it's a start:

image

@andrewserong andrewserong added [Block] Post Template Affects the Post Template Block [Feature] Layout Layout block support, its UI controls, and style output. labels Feb 23, 2023
@andrewserong andrewserong self-assigned this Feb 23, 2023
@github-actions
Copy link

Flaky tests detected in 08dabf0.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4249790365
📝 Reported issues:

@johnbillion johnbillion deleted the try/add-flex-layout-and-block-spacing-to-post-template-block branch February 10, 2025 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Template Affects the Post Template Block [Feature] Layout Layout block support, its UI controls, and style output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant