equalizedigital / accessibility-new-window-warnings

7 stars 0 forks source link

Use aria-labelledby and an appended element if `lang` attribute present. #9

Open joedolson opened 1 year ago

joedolson commented 1 year ago

Per the HTML spec and assistive technology behavior, the aria-label of an element is announced using the language of the html element, and ignores any lang attribute defined on the element itself. Because of this, putting the text into an aria-label attribute can create a language of parts violation.

SteveJonesDev commented 1 year ago

@joedolson, would screen reader text be a more straightforward solution?

joedolson commented 1 year ago

Screen reader text is more straightforward, and has the advantage that it's available when CSS fails. The CSS always annoys me when adding any front-end screen reader text, since you pretty much always have to add potentially duplicate CSS, but :shrug:.