Skip to content

Border radius is not applied to overlay element #44262

@mikachan

Description

@mikachan

Description

If the Post Featured Image or Cover block has a border-radius set in theme.json, and the block has an overlay set, the border-radius is not applied to the overlay element.

With the Post Featured image block, the overlay shows with square corners on top of the border-radius:
image

For the featured image, I think we should apply the border-radius to the overlay, as well as the image.

With the Cover block, the border-radius does not appear at all (it's applied to the container element):
image

For the cover block, it looks like the border-radius needs to be applied to the nested image and the overlay.

This issue was found when testing the Canary style variation in Twenty Twenty-Three.

Step-by-step reproduction instructions

  1. Activate the Twenty Twenty-Three theme and select the Canary variation
  2. Open the canary.json file in styles directory and add the following under styles.blocks:
"core/cover": {
	"border": {
		"radius": "100px 0 0 0"
	}
},
  1. Notice that the border-radius is not applied correctly to the overlay on the front end

To test the featured image, use the following markup in place of the cover block in the single template:

<!-- wp:post-featured-image {"overlayColor":"contrast","dimRatio":50,"align":"wide"} /-->

The border-radius for the featured image is already set in canary.json, under core/post-featured-image. Notice how this is not applied correctly.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Labels

[Block] CoverAffects the Cover Block - used to display content laid over a background image[Block] Post Featured ImageAffects the Post Featured Image Block

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions