WebWeWant / webwewant.fyi

If you build websites, you inevitably run into problems. Maybe there’s no way to achieve an aspect of your design using CSS. Or maybe there’s a device feature you really wish you could tap into using JavaScript. Or perhaps the in-browser DevTools don’t give you a key insight you need to do your job. We want to hear about it!
https://webwewant.fyi
MIT License
74 stars 23 forks source link

An HTML attribute to indicate an element that is for screen readers only #558

Open WebWeWantBot opened 2 years ago

WebWeWantBot commented 2 years ago

title: An HTML attribute to indicate an element that is for screen readers only date: 2022-06-24T13:29:40.914Z submitter: Joppe Kroon number: 62b5bc44621ffa0058c5203c tags: [ ] discussion: https://github.com/WebWeWant/webwewant.fyi/discussions/ status: [ discussing || in-progress || complete ] related:

To add some necessary context or labelling for non-visual screen reader users, e.g. an icon button, you have to add some text that is visually hidden.

One option is "aria-label", but this is not always a viable solution, and it has long standing issues with translation software, etc.

The other solution is to apply a convoluted set of CSS declarations that cause the element to be invisible, but the browser doesn't realize it so it won't optimize it away. See "CSS clip" at https://webaim.org/techniques/css/invisiblecontent/#techniques

Although the CSS clip trick works well, it

A HTML attribute on the other hand would be


If posted, this will appear at https://webwewant.fyi/wants/62b5bc44621ffa0058c5203c/