Changeset 58243
- Timestamp:
- 05/30/2024 04:08:56 AM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-supports/layout.php
r58241 r58243 225 225 * @since 6.3.0 Added grid layout type. 226 226 * @since 6.6.0 Removed duplicated selector from layout styles. 227 * Enabled negative margins for alignfull children of blocks with custom padding. 227 228 * @access private 228 229 * … … 308 309 ) 309 310 ); 310 311 if ( isset( $block_spacing ) ) { 312 $block_spacing_values = wp_style_engine_get_styles( 313 array( 314 'spacing' => $block_spacing, 315 ) 311 } 312 313 if ( isset( $block_spacing ) ) { 314 $block_spacing_values = wp_style_engine_get_styles( 315 array( 316 'spacing' => $block_spacing, 317 ) 318 ); 319 320 /* 321 * Handle negative margins for alignfull children of blocks with custom padding set. 322 * They're added separately because padding might only be set on one side. 323 */ 324 if ( isset( $block_spacing_values['declarations']['padding-right'] ) ) { 325 $padding_right = $block_spacing_values['declarations']['padding-right']; 326 $layout_styles[] = array( 327 'selector' => "$selector > .alignfull", 328 'declarations' => array( 'margin-right' => "calc($padding_right * -1)" ), 316 329 ); 317 318 /* 319 * Handle negative margins for alignfull children of blocks with custom padding set. 320 * They're added separately because padding might only be set on one side. 321 */ 322 if ( isset( $block_spacing_values['declarations']['padding-right'] ) ) { 323 $padding_right = $block_spacing_values['declarations']['padding-right']; 324 $layout_styles[] = array( 325 'selector' => "$selector > .alignfull", 326 'declarations' => array( 'margin-right' => "calc($padding_right * -1)" ), 327 ); 328 } 329 if ( isset( $block_spacing_values['declarations']['padding-left'] ) ) { 330 $padding_left = $block_spacing_values['declarations']['padding-left']; 331 $layout_styles[] = array( 332 'selector' => "$selector > .alignfull", 333 'declarations' => array( 'margin-left' => "calc($padding_left * -1)" ), 334 ); 335 } 330 } 331 if ( isset( $block_spacing_values['declarations']['padding-left'] ) ) { 332 $padding_left = $block_spacing_values['declarations']['padding-left']; 333 $layout_styles[] = array( 334 'selector' => "$selector > .alignfull", 335 'declarations' => array( 'margin-left' => "calc($padding_left * -1)" ), 336 ); 336 337 } 337 338 }
Note: See TracChangeset
for help on using the changeset viewer.