Skip to content

Commit

Permalink
Use is-layout pattern on layout generated classname (#57564)
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines authored Jan 7, 2024
1 parent 9e93d55 commit cb8df38
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/block-supports/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ function gutenberg_render_layout_support_flag( $block_content, $block ) {
* for features like the enhanced pagination of the Query block.
*/
$container_class = gutenberg_incremental_id_per_prefix(
'wp-container-' . sanitize_title( $block['blockName'] ) . '-layout-'
'wp-container-' . sanitize_title( $block['blockName'] ) . '-is-layout-'
);

// Set the correct layout type for blocks using legacy content width.
Expand Down Expand Up @@ -893,7 +893,7 @@ function gutenberg_restore_group_inner_container( $block_content, $block ) {
if ( $classes ) {
$classes = explode( ' ', $classes );
foreach ( $classes as $class_name ) {
if ( str_contains( $class_name, 'layout' ) ) {
if ( str_contains( $class_name, 'is-layout-' ) ) {
array_push( $layout_classes, $class_name );
$processor->remove_class( $class_name );
}
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/hooks/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ function BlockWithLayoutStyles( { block: BlockListBlock, props } ) {
const layoutClasses = useLayoutClasses( attributes, name );

const { kebabCase } = unlock( componentsPrivateApis );
const selectorPrefix = `wp-container-${ kebabCase( name ) }-layout-`;
const selectorPrefix = `wp-container-${ kebabCase( name ) }-is-layout-`;
// Higher specificity to override defaults from theme.json.
const selector = `.${ selectorPrefix }${ id }.${ selectorPrefix }${ id }`;
const [ blockGapSupport ] = useSettings( 'spacing.blockGap' );
Expand Down

0 comments on commit cb8df38

Please sign in to comment.