mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-09 09:57:38 +01:00
Editor: revert add grid layout type
Reverting the previous commit because it causes e2e to fail on trunk. See #58554. Built from https://develop.svn.wordpress.org/trunk@55958 git-svn-id: http://core.svn.wordpress.org/trunk@55470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
03f5a6e91d
commit
06beef84d5
@ -34,7 +34,6 @@ function wp_register_layout_support( $block_type ) {
|
|||||||
*
|
*
|
||||||
* @since 5.9.0
|
* @since 5.9.0
|
||||||
* @since 6.1.0 Added `$block_spacing` param, use style engine to enqueue styles.
|
* @since 6.1.0 Added `$block_spacing` param, use style engine to enqueue styles.
|
||||||
* @since 6.3.0 Added grid layout type.
|
|
||||||
* @access private
|
* @access private
|
||||||
*
|
*
|
||||||
* @param string $selector CSS selector.
|
* @param string $selector CSS selector.
|
||||||
@ -288,44 +287,6 @@ function wp_get_layout_style( $selector, $layout, $has_block_gap_support = false
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ( 'grid' === $layout_type ) {
|
|
||||||
if ( ! empty( $layout['columnCount'] ) ) {
|
|
||||||
$layout_styles[] = array(
|
|
||||||
'selector' => $selector,
|
|
||||||
'declarations' => array( 'grid-template-columns' => 'repeat(' . $layout['columnCount'] . ', minmax(0, 1fr))' ),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$minimum_column_width = ! empty( $layout['minimumColumnWidth'] ) ? $layout['minimumColumnWidth'] : '12rem';
|
|
||||||
|
|
||||||
$layout_styles[] = array(
|
|
||||||
'selector' => $selector,
|
|
||||||
'declarations' => array( 'grid-template-columns' => 'repeat(auto-fill, minmax(min(' . $minimum_column_width . ', 100%), 1fr))' ),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $has_block_gap_support && isset( $gap_value ) ) {
|
|
||||||
$combined_gap_value = '';
|
|
||||||
$gap_sides = is_array( $gap_value ) ? array( 'top', 'left' ) : array( 'top' );
|
|
||||||
|
|
||||||
foreach ( $gap_sides as $gap_side ) {
|
|
||||||
$process_value = is_string( $gap_value ) ? $gap_value : _wp_array_get( $gap_value, array( $gap_side ), $fallback_gap_value );
|
|
||||||
// Get spacing CSS variable from preset value if provided.
|
|
||||||
if ( is_string( $process_value ) && str_contains( $process_value, 'var:preset|spacing|' ) ) {
|
|
||||||
$index_to_splice = strrpos( $process_value, '|' ) + 1;
|
|
||||||
$slug = _wp_to_kebab_case( substr( $process_value, $index_to_splice ) );
|
|
||||||
$process_value = "var(--wp--preset--spacing--$slug)";
|
|
||||||
}
|
|
||||||
$combined_gap_value .= "$process_value ";
|
|
||||||
}
|
|
||||||
$gap_value = trim( $combined_gap_value );
|
|
||||||
|
|
||||||
if ( null !== $gap_value && ! $should_skip_gap_serialization ) {
|
|
||||||
$layout_styles[] = array(
|
|
||||||
'selector' => $selector,
|
|
||||||
'declarations' => array( 'gap' => $gap_value ),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! empty( $layout_styles ) ) {
|
if ( ! empty( $layout_styles ) ) {
|
||||||
|
@ -1370,7 +1370,7 @@ class WP_Theme_JSON {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
! empty( $class_name ) &&
|
! empty( $class_name ) &&
|
||||||
is_array( $base_style_rules )
|
! empty( $base_style_rules )
|
||||||
) {
|
) {
|
||||||
// Output display mode. This requires special handling as `display` is not exposed in `safe_style_css_filter`.
|
// Output display mode. This requires special handling as `display` is not exposed in `safe_style_css_filter`.
|
||||||
if (
|
if (
|
||||||
|
@ -332,28 +332,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
"grid": {
|
|
||||||
"name": "grid",
|
|
||||||
"slug": "grid",
|
|
||||||
"className": "is-layout-grid",
|
|
||||||
"displayMode": "grid",
|
|
||||||
"baseStyles": [
|
|
||||||
{
|
|
||||||
"selector": " > *",
|
|
||||||
"rules": {
|
|
||||||
"margin": "0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"spacingStyles": [
|
|
||||||
{
|
|
||||||
"selector": "",
|
|
||||||
"rules": {
|
|
||||||
"gap": null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.3-alpha-55957';
|
$wp_version = '6.3-alpha-55958';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user