equalizedigital / accessibility-checker

GNU General Public License v2.0
15 stars 8 forks source link

Additional core block exclusions on aria-hidden #567

Open amberhinds opened 3 months ago

amberhinds commented 3 months ago

Is your feature request related to a problem? Please describe.

There are some correct uses of aria-hidden related to core blocks that it would be good for us to exclude from flagging an aria-hidden warning because we know that they are correct.

Describe the solution you'd like

Screenshot 2024-03-30 at 9 38 13 PM

Here are the code snippets: <span aria-hidden="true" class="wp-block-cover__background has-background-dim"></span>

<span class="wp-block-post-featured-image__overlay has-background-dim has-background-dim-10 has-contrast-2-background-color" style="border-radius:5px" aria-hidden="true"></span>

Why do you think this feature is something we should consider for this plugin?

We should avoid as many false positives as we can and make our rules the best ruleset for WordPress. 🙂

pattonwebz commented 3 months ago

@amberhinds does the .has-background-dim class matter here on either of these 2 pieces of block markup when it comes to determining if they are valid uses of aria-hidden or not?

amberhinds commented 3 months ago

I think you can use that as the attribute to ignore, probably. It's the span that overlays images to ensure text on them is readable on the cover block. You can see one on my website here: https://amberhinds.com/about/

Screenshot 2024-04-01 at 9 14 52 AM