Jump to content

Topic on Talk:Best practices for extensions

Confusing A11y guideline about ids

10
Michael Große (WMDE) (talkcontribs)

I'm confused by this item in the section about Accessibility:


SHOULD: HTML element's IDs should only be rarely, for things to which you can navigate. Everything else should be a class – even if you expect to use it only once, use a class name instead.


Why would that be an accessibility consideration? Most accessibility uses for ids aren't related to navigation and can't be replaced by classes (for example, the target of an aria-described-by="" and such).

I can see that ids should not be used for styling, but that is not an accessibility concern. And I can see that ids must be unique, but that is a MUST and also affects much more than only accessibility.


Am I missing something here?

TheDJ (talkcontribs)

Correct. however those should generally be auto-generated ids (again to guarantee uniqueness), but yes, this is more of a code convention than an accessibility concern.

AKlapper (WMF) (talkcontribs)
Michael Große (WMDE) (talkcontribs)
AKlapper (WMF) (talkcontribs)

Done.

Jdforrester (WMF) (talkcontribs)

But none of that is written in terms of should/must, so now we're adding a fudge factor back into the process, whereas this entire document is meant to be a "one-stop-shop" where if you pass all the items you can be pretty sure you could as 'best practice.

AKlapper (WMF) (talkcontribs)
Jdforrester (WMF) (talkcontribs)

I'd rather you did that, as the editor of this area here, Andre.

Jdforrester (WMF) (talkcontribs)

OK, it's been a month, we can just revert your removal Andre if you don't have time to do the work?

AKlapper (WMF) (talkcontribs)

Surely we can duplicate content (and likely make things go out of sync), however I don't think it's a good idea when there are already guidelines for an area to add yet another place with guidelines for that area. For the time being, feel free to go ahead.

Reply to "Confusing A11y guideline about ids"