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

Support Block Spacing API on custom containers #511

Merged
merged 77 commits into from
Jul 29, 2024

Conversation

stian-overasen
Copy link
Member

@stian-overasen stian-overasen commented Jun 28, 2024

When combining Block Spacing from WP with T2 Custom Block Margin v2 we limit the active containers to only the ones used by core (.wp-site-blocks, .is-layout-constrained, .is-layout-flow). This works fine for most of the core blocks, including: Group, Column, Query, Post Content, Cover, Details and Buttons.

However, there are additional blocks where we might want to use the same block spacing (Media+Text, T2 Simple Media+Text, T2 Accordion, T2 Factbox, T2 Infobox, T2 FAQ Item). These blocks lack the .is-layout-* class and therefore their child elements are not covered by the generated block spacing styles.

This PR adds an override filter for these blocks and adds is-layout-flow class to the desired containers.

This might not be the best approach, but it works for now. One alternative solution would be to add layout suppport to the T2 blocks, but we would still have to use the filter for Media+Text.

Copy link

github-actions bot commented Jun 28, 2024

Composer package changes
Prod Packages Operation Base Target
johnpbloch/wordpress-core New - 6.6.x-dev fb2c46f
johnpbloch/wordpress-core-installer New - 2.0.0

@stian-overasen stian-overasen changed the base branch from main to new-block-theme June 28, 2024 22:57
Base automatically changed from new-block-theme to main July 29, 2024 06:34
@stian-overasen stian-overasen changed the title Possible solution to combine T2 Custom Block Margin v2 with Block Spacing/blockGap Support Block Spacing API on custom containers Jul 29, 2024
@stian-overasen stian-overasen marked this pull request as ready for review July 29, 2024 10:46
@stian-overasen
Copy link
Member Author

We'll keep this in Project Base for now and move it to T2 after testing it out in a project.

@stian-overasen stian-overasen merged commit b769d0e into main Jul 29, 2024
4 checks passed
@stian-overasen stian-overasen deleted the possible-block-gap-solution branch July 29, 2024 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants