equinor / energyvision

Home of the equinor.com website
https://www.equinor.com
MIT License
34 stars 8 forks source link

add aria fields to all link and button inputs #540

Closed SvSven closed 2 years ago

SvSven commented 3 years ago

Link and button fields in Sanity should have the option to add a aria-label so that editors can set a different, more descriptive label for screen reader users

Example: An editor adds a teaser component and uses "Read more" as label for the link/button. This is not an accessible label as it is not at all descriptive about where the link goes. Solution: either add a more descriptive label for all users, or set a specific aria-label for screen readers.

List of places to add

wenche commented 3 years ago

This must also be reflected in the web. It's already done for the LinkSelector object, so we could probably use that as a starting point

wenche commented 2 years ago

This should probably be restricted to things like Teaser, Cards, Promo where the link is in context of something? It shouldn't be for things like the Related content list in a news article.

SvSven commented 2 years ago

I guess in theory it should apply to any link where the editors may use "useless" labels such as for example "read more" or "click here" - but that would include inline links inside of the rich text editor as well.

I think the main ones are the Teaser, Cards, and Promo Tiles like you mention yes. Maybe we can make a "LinkLabel" object for this so we can reuse it wherever we need? 🤔

wenche commented 2 years ago

Internal and external links in Text block in topic pages Skjermbilde 2021-10-25 kl. 10.00.21.png Skjermbilde 2021-10-25 kl. 10.20.10.png

wenche commented 2 years ago

Teaser and promo (promo was already fixed)

Skjermbilde 2021-10-25 kl. 11.26.55.png Skjermbilde 2021-10-25 kl. 11.34.15.png

wenche commented 2 years ago

I think the main ones are the Teaser, Cards, and Promo Tiles like you mention yes. Maybe we can make a "LinkLabel" object for this so we can reuse it wherever we need? 🤔

The Teaser and Promo tiles already uses the linkSelector object, and TextBlock works slightly different :) For Cards the whole card is wrapped inside a link

SvSven commented 2 years ago

LGTM 👍