devinsays / portfolio-press

A WordPress theme for artists and designers to showcase their work.
https://wptheming.com/portfolio-theme/
GNU General Public License v2.0
62 stars 30 forks source link

Add a bit of a11y to post link #120

Closed ogonkov closed 6 years ago

ogonkov commented 6 years ago

Explicitly set label for post link.

ogonkov commented 6 years ago

@devinsays what about this one?

devinsays commented 6 years ago

I just read up on this: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-labelledby_attribute.

I'm not sure I completely understand how this attribute works.

The markup in Portfolio Press is basically this <a><h3>Content</h3><image></a>. When a screen reader reads this, is it not clear the a refers to the h3 inside?

Happy to merge, I just want to make 100% sure it is helpful markup.

ogonkov commented 6 years ago

Looks like that, aXe checker warn me about this issues

https://dequeuniversity.com/rules/axe/3.0/link-name

And for missing alt of images https://dequeuniversity.com/rules/axe/3.0/image-alt

devinsays commented 6 years ago

Okay, by reading the spec I'm not totally convinced it's needed, but I'll merge.

A blank alt="" tag doesn't really improve accessibility. If you have time and feel like submitting a pull request that gets the actual set caption for a featured image (if one is set in the media library) I'd be happy to merge that.

ogonkov commented 6 years ago

alt is required only for important images, i feels that in most cases alt would duplicate header of the post