Changeset 54311
- Timestamp:
- 09/26/2022 02:56:41 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-supports/layout.php
r54275 r54311 57 57 } 58 58 if ( null !== $gap_value && ! $should_skip_gap_serialization ) { 59 // Get spacing CSS variable from preset value if provided. 60 if ( is_string( $gap_value ) && str_contains( $gap_value, 'var:preset|spacing|' ) ) { 61 $index_to_splice = strrpos( $gap_value, '|' ) + 1; 62 $slug = _wp_to_kebab_case( substr( $gap_value, $index_to_splice ) ); 63 $gap_value = "var(--wp--preset--spacing--$slug)"; 64 } 65 59 66 array_push( 60 67 $layout_styles, -
trunk/tests/phpunit/tests/block-supports/wpGetLayoutStyle.php
r54274 r54311 249 249 'expected_output' => '.wp-layout{flex-wrap:nowrap;flex-direction:column;align-items:flex-start;}', 250 250 ), 251 'default layout with blockGap to verify converting gap value into valid CSS' => array( 252 'args' => array( 253 'selector' => '.wp-block-group.wp-container-6', 254 'layout' => array( 255 'type' => 'default', 256 ), 257 'has_block_gap_support' => true, 258 'gap_value' => 'var:preset|spacing|70', 259 'block_spacing' => array( 260 'blockGap' => 'var(--wp--preset--spacing--70)', 261 ), 262 ), 263 'expected_output' => '.wp-block-group.wp-container-6 > *{margin-block-start:0;margin-block-end:0;}.wp-block-group.wp-container-6.wp-block-group.wp-container-6 > * + *{margin-block-start:var(--wp--preset--spacing--70);margin-block-end:0;}', 264 ), 251 265 ); 252 266 }
Note: See TracChangeset
for help on using the changeset viewer.