close
Skip to content

Image caption blur overlay affects large portion of images #74056

@iamtakashi

Description

@iamtakashi

Description

Image captions using the wp-block-gallery layout apply a blur effect to a large vertical area of tall images, rather than just behind the caption. This causes the blur overlay to extend across a significant portion of the image rather than being limited to the figcaption.

Image

This CSS is in question.

.wp-block-gallery.has-nested-images figure.wp-block-image:has(figcaption):before {
    backdrop-filter: blur(3px);
    content: "";
    height: 100%;
    -webkit-mask-image: linear-gradient(0deg, #000 20%, #0000);
    mask-image: linear-gradient(0deg, #000 20%, #0000);
    max-height: 40%;
    pointer-events: none;
}

For the max-height, we could use min() function or apply the blur effect to figcaption.

Step-by-step reproduction instructions

  1. Add a long image, like a screenshot of a webpage, using a gallery block
  2. Add a caption
  3. See the blur effect

Screenshots, screen recording, code snippet

No response

Environment info

WP 6.9
Gutenberg trunk

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

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] ImageAffects the Image Block[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions