Changeset 55957
- Timestamp:
- 06/21/2023 05:54:27 AM (18 months ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-supports/layout.php
r55956 r55957 35 35 * @since 5.9.0 36 36 * @since 6.1.0 Added `$block_spacing` param, use style engine to enqueue styles. 37 * @since 6.3.0 Added grid layout type. 37 38 * @access private 38 39 * … … 285 286 'selector' => $selector, 286 287 'declarations' => array( 'justify-content' => $vertical_alignment_options[ $layout['verticalAlignment'] ] ), 288 ); 289 } 290 } 291 } elseif ( 'grid' === $layout_type ) { 292 if ( ! empty( $layout['columnCount'] ) ) { 293 $layout_styles[] = array( 294 'selector' => $selector, 295 'declarations' => array( 'grid-template-columns' => 'repeat(' . $layout['columnCount'] . ', minmax(0, 1fr))' ), 296 ); 297 } else { 298 $minimum_column_width = ! empty( $layout['minimumColumnWidth'] ) ? $layout['minimumColumnWidth'] : '12rem'; 299 300 $layout_styles[] = array( 301 'selector' => $selector, 302 'declarations' => array( 'grid-template-columns' => 'repeat(auto-fill, minmax(min(' . $minimum_column_width . ', 100%), 1fr))' ), 303 ); 304 } 305 306 if ( $has_block_gap_support && isset( $gap_value ) ) { 307 $combined_gap_value = ''; 308 $gap_sides = is_array( $gap_value ) ? array( 'top', 'left' ) : array( 'top' ); 309 310 foreach ( $gap_sides as $gap_side ) { 311 $process_value = is_string( $gap_value ) ? $gap_value : _wp_array_get( $gap_value, array( $gap_side ), $fallback_gap_value ); 312 // Get spacing CSS variable from preset value if provided. 313 if ( is_string( $process_value ) && str_contains( $process_value, 'var:preset|spacing|' ) ) { 314 $index_to_splice = strrpos( $process_value, '|' ) + 1; 315 $slug = _wp_to_kebab_case( substr( $process_value, $index_to_splice ) ); 316 $process_value = "var(--wp--preset--spacing--$slug)"; 317 } 318 $combined_gap_value .= "$process_value "; 319 } 320 $gap_value = trim( $combined_gap_value ); 321 322 if ( null !== $gap_value && ! $should_skip_gap_serialization ) { 323 $layout_styles[] = array( 324 'selector' => $selector, 325 'declarations' => array( 'gap' => $gap_value ), 287 326 ); 288 327 } -
trunk/src/wp-includes/class-wp-theme-json.php
r55956 r55957 1371 1371 if ( 1372 1372 ! empty( $class_name ) && 1373 ! empty( $base_style_rules )1373 is_array( $base_style_rules ) 1374 1374 ) { 1375 1375 // Output display mode. This requires special handling as `display` is not exposed in `safe_style_css_filter`. -
trunk/src/wp-includes/theme.json
r55956 r55957 318 318 } 319 319 }, 320 { 321 "selector": " > *", 322 "rules": { 323 "margin": "0" 324 } 325 } 326 ], 327 "spacingStyles": [ 328 { 329 "selector": "", 330 "rules": { 331 "gap": null 332 } 333 } 334 ] 335 }, 336 "grid": { 337 "name": "grid", 338 "slug": "grid", 339 "className": "is-layout-grid", 340 "displayMode": "grid", 341 "baseStyles": [ 320 342 { 321 343 "selector": " > *",
Note: See TracChangeset
for help on using the changeset viewer.