Skip to content

Commit

Permalink
Remove class in favor of a new approach checking the children
Browse files Browse the repository at this point in the history
  • Loading branch information
renatho committed Oct 23, 2024
1 parent 3369f0f commit c108205
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 1 addition & 2 deletions packages/block-library/src/cover/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,7 @@ function CoverEdit( {
'has-custom-content-position':
! isContentPositionCenter( contentPosition ),
},
getPositionClassName( contentPosition ),
'has-no-zindex-in-inner-blocks'
getPositionClassName( contentPosition )
);

const showOverlay =
Expand Down
3 changes: 1 addition & 2 deletions packages/block-library/src/cover/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ export default function save( { attributes } ) {
'has-custom-content-position':
! isContentPositionCenter( contentPosition ),
},
getPositionClassName( contentPosition ),
'has-no-zindex-in-inner-blocks'
getPositionClassName( contentPosition )
);

const imgClasses = clsx(
Expand Down
10 changes: 9 additions & 1 deletion packages/block-library/src/cover/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,15 @@ section.wp-block-cover-image > h2,
}

// Backward compatibility for v14 deprecation.
.wp-block-cover:not(.has-no-zindex-in-inner-blocks) {
// This wrapper selector is used to identify when the
// .wp-block-cover__background comes after the other elements (new HTML
// structure after the deprecation).
.wp-block-cover:not(
.wp-block-cover:has(
.wp-block-cover__image-background + .wp-block-cover__background,
.wp-block-cover__video-background + .wp-block-cover__background
)
) {
.wp-block-cover__video-background {
z-index: z-index(".wp-block-cover__video-background");
}
Expand Down

0 comments on commit c108205

Please sign in to comment.