Skip to content

Commit

Permalink
Update resolver class to add an empty blockGap placeholder for a bloc…
Browse files Browse the repository at this point in the history
…k, if it provides a default blockGap value
  • Loading branch information
andrewserong authored and tellthemachines committed Jul 12, 2022
1 parent ba675a3 commit eb6c662
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/compat/wordpress-6.1/class-wp-theme-json-6-1.php
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ function( $pseudo_selector ) use ( $selector ) {
$block_rules .= '.wp-site-blocks > .alignright { float: right; margin-left: 2em; }';
$block_rules .= '.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }';

$has_block_gap_support = _wp_array_get( $this->theme_json, array( 'settings', 'spacing', 'blockGap' ) ) !== null;
if ( $has_block_gap_support ) {
$block_rules .= '.wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }';
$block_rules .= ".wp-site-blocks > * + * { margin-block-start: $block_gap_value; }";
Expand Down

0 comments on commit eb6c662

Please sign in to comment.