Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Add visually-hidden attribute / CSS property #206

Open
RoyalIcing opened this issue Sep 17, 2021 · 2 comments
Open

Add visually-hidden attribute / CSS property #206

RoyalIcing opened this issue Sep 17, 2021 · 2 comments

Comments

@RoyalIcing
Copy link

RoyalIcing commented Sep 17, 2021

To make an accessible but visually pleasing website, we often need to add a visually-hidden (or sometimes called sr-only) CSS class.

What it does is allow it to be seen by assistive tech like screen readers by keeping the target element in the accessibility tree, but visually hides it so visual users don’t see it. It can be heard, but not seen.

The usual approach is to add a CSS rule like so:

However, it’s a bit of a hack.

It would be amazing if this core functionality could be built into browsers, and one that applies the best practice CSS approach.

It would ideally work fantastically with search too — perhaps a visually-hidden element is still searchable. I’m not familiar with how screen reader search usually works (do they use the usual search or a have different way of searching)?

@RoyalIcing RoyalIcing changed the title Add visually-hidden attribute Add visually-hidden attribute / CSS property Sep 17, 2021
@vmpstr
Copy link
Collaborator

vmpstr commented Sep 20, 2021

I think this is a good idea. I wonder if whatwg or csswg is a better spot to discuss this though. I'm not sure if there are accessibility specific working groups too.

@chrishtr
Copy link
Collaborator

Agree that this should be an HTML or CSSWG issue instead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants