Skip to content

Feature: Add aria-label, aria-labelledby, and aria-describedby support #576

@svinkle

Description

@svinkle

Based on the article, Short note on aria-label, aria-labelledby, and aria-describedby by @LJWatson, the aria-label, aria-labelledby, and aria-describedby HTML attributes have specific support and use cases. It would be great if these were included in the lint tests.

Specifically, these attributes are supported and applicable on the following HTML elements:

  • a[href]
  • audio[controls]
  • button
  • iframe
  • img
  • input:not([type="hidden"])
  • select
  • textarea
  • video[controls]

Also included are landmark elements such as:

  • header
  • footer
  • main
  • nav
  • aside
  • section
  • form

The attributes are also supported on widget elements with an explicit role.

If any other element includes these attributes, it should lead to a warning message such as:

The aria-label attribute must only be included on interactive elements, elements with an implicit or explicit role, iframe elements, or image elements.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions