Skip to content

Cover block reports color contrast accessibility error #39692

@webmandesign

Description

@webmandesign

Description

Since WordPress 5.9.1 the Cover block background setup was moved from block container HTML element into a child element. So, the container element has left with no background color set, while the text color is set to white by default.

Accessibility evaluation tools such as Wave now throw color contrast error.

The solution would be to set the Cover block background color by default, just like it is with its text color. Something like this could work:
.wp-block-cover:not(.has-background) { background: #000; }

But I understand the fix is not for all cases. But hopefully it should cover the majority of cases anyway. What do you say, guys, how we should approach this?

Step-by-step reproduction instructions

  1. You can see this when testing https://themedemos.webmandesign.eu/eimear/ - the "DISCOVER MORE" section in the middle of the page throws an error in Wave https://wave.webaim.org/report#/https://themedemos.webmandesign.eu/eimear/

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.

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] CoverAffects the Cover Block - used to display content laid over a background image[Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions