File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
packages/block-library/src/cover Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,12 @@ export default function save( { attributes } ) {
143143 />
144144 ) }
145145
146+ { /* The `wp-block-cover__background` needs to be immediately before
147+ the `wp-block-cover__inner-container`, so the exclusion CSS selector
148+ `.wp-block-cover__background + .wp-block-cover__inner-container`
149+ works properly. If it needs to be changed in the future, the
150+ selector for the backward compatibility for v14 deprecation also
151+ needs change. */ }
146152 < span
147153 aria-hidden = "true"
148154 className = { clsx (
Original file line number Diff line number Diff line change 9494 }
9595
9696 .wp-block-cover__inner-container {
97- position : relative ; // Needed after the v14 deprecation. .
97+ position : relative ; // Needed for the inner container to be positioned above other elements with absolute positioning .
9898 width : 100% ;
9999 color : inherit ;
100100 // Reset the fixed LTR direction at the root of the block in RTL languages.
@@ -289,13 +289,14 @@ section.wp-block-cover-image > h2,
289289}
290290
291291// Backward compatibility for v14 deprecation. Only applied to the frontend.
292+ // Regarding the `.wp-block-cover__background + .wp-block-cover__inner-container`
293+ // selector: When the `.wp-block-cover__inner-container` comes right after the
294+ // `.wp-block-cover__background` , it means that it's using the new HTML
295+ // structure or that it's using the color background or gradient (even in
296+ // the deprecated version). In the color background or gradient option we don't
297+ // need the z-index because the elements are in the expected order.
292298body :not (.editor-styles-wrapper ) .wp-block-cover :not (
293299.wp-block-cover :has (
294- /* When the `.wp-block-cover__inner-container` comes right after the
295- `.wp-block-cover__background` , it means that it's using the new HTML
296- structure or that it's using the color background or gradient (even in
297- the deprecated version). In the last option we also don't need the z-index
298- because the elements are in the expected order. */
299300 .wp-block-cover__background + .wp-block-cover__inner-container
300301)
301302) {
You can’t perform that action at this time.
0 commit comments