Skip to content

Commit

Permalink
Describe possible solution for pickup after summer
Browse files Browse the repository at this point in the history
  • Loading branch information
stian-overasen committed Jun 28, 2024
1 parent e28fd05 commit c9214e1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/themes/block-theme/includes/block-margin.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function do_override_last_selectors(): array {
function do_override_custom_block_margin_config( array $config, $root_selector ): array {

// Simplify selector to include all constrained containers and selected inner block containers.
/*

Check failure on line 53 in packages/themes/block-theme/includes/block-margin.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Empty line required before block comment
$config['selector'] = ":is(
{$root_selector} .wp-site-blocks,
{$root_selector} .entry-content.is-layout-constrained,
Expand All @@ -61,6 +62,27 @@ function do_override_custom_block_margin_config( array $config, $root_selector )
{$root_selector} .wp-block-query,
{$root_selector} [class*=\"__inner-container\"],
)";
*/
$config['selector'] = "{$root_selector} :is(
.wp-site-blocks,
.is-layout-constrained,
.is-layout-flow,
.is-layout-flex.is-vertical,
)";

/*
TODO:
To use core blockGap we need a way to extend it to custom containers, e.g.:
- wp-block-media-text__content
- t2-simple-media-text__content
- others?
Possible solution:
Override rendering for blocks and insert .is-layout-flow class:
- For core/media+text: Add .is-layout-flow to .wp-block-media-text__content
- For t2/simple-media-text: Add .is-layout-flow to .t2-simple-media-text__content-inner
- For gravityforms/form: Add .is-layout-flow to .gform_heading
*/

$config['gaps'] = [
'00' => [
Expand Down

0 comments on commit c9214e1

Please sign in to comment.