Skip to content

Linter: Implement a11y-no-visually-hidden-interactive-elements rule #1225

Description

@marcoroth

Implement the GitHub::Accessibility::NoVisuallyHiddenInteractiveElements rule from erblint-github.

Rule Details

This rule guards against visually hiding interactive elements. If a sighted keyboard user navigates to an interactive element that is visually hidden they might become confused and assume that keyboard focus has been lost.

Note: input elements are not flagged at this time as some visually hidden inputs might cause false positives (e.g. file inputs).

Examples

Incorrect code for this rule:

<button class="sr-only">Submit</button>

Correct code for this rule:

<h2 class="sr-only">Welcome to GitHub</h2>

References

Parent Issue

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions