Skip to content

Commit da351bf

Browse files
Front end support
1 parent 4555b58 commit da351bf

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/block-supports/layout.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,11 @@ function gutenberg_get_layout_style( $selector, $layout, $has_block_gap_support
200200
);
201201

202202
if ( 'horizontal' === $layout_orientation ) {
203-
$justify_content_options += array( 'space-between' => 'space-between' );
203+
$justify_content_options += array( 'space-between' => 'space-between' );
204+
$vertical_alignment_options += array( 'stretch' => 'stretch' );
205+
} else {
206+
$justify_content_options += array( 'stretch' => 'stretch' );
207+
$vertical_alignment_options += array( 'spaceBetween' => 'space-between' );
204208
}
205209

206210
if ( ! empty( $layout['flexWrap'] ) && 'nowrap' === $layout['flexWrap'] ) {
@@ -269,6 +273,12 @@ function gutenberg_get_layout_style( $selector, $layout, $has_block_gap_support
269273
'declarations' => array( 'align-items' => 'flex-start' ),
270274
);
271275
}
276+
if ( ! empty( $layout['verticalAlignment'] ) && array_key_exists( $layout['verticalAlignment'], $vertical_alignment_options ) ) {
277+
$layout_styles[] = array(
278+
'selector' => $selector,
279+
'declarations' => array( 'justify-content' => $vertical_alignment_options[ $layout['verticalAlignment'] ] ),
280+
);
281+
}
272282
}
273283
}
274284

0 commit comments

Comments
 (0)