--- stage: none group: unassigned info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments --- # Accessibility Accessibility is important for users who use screen readers or rely on keyboard-only functionality to ensure they have an equivalent experience to sighted mouse users. This page contains guidelines we should follow. ## Quick summary Since [no ARIA is better than bad ARIA](https://www.w3.org/TR/wai-aria-practices/#no_aria_better_bad_aria), review the following recommendations before using `aria-*`, `role`, and `tabindex`. Use semantic HTML, which typically has accessibility semantics baked in, but always be sure to test with [relevant combinations of screen readers and browsers](https://www.accessibility-developer-guide.com/knowledge/screen-readers/relevant-combinations/). In [WebAIM's accessibility analysis of the top million home pages](https://webaim.org/projects/million/#aria), they found that "ARIA correlated to higher detectable errors". It is likely that *misuse* of ARIA is a big cause of increased errors, so when in doubt don't use `aria-*`, `role`, and `tabindex`, and stick with semantic HTML. ## Provide accessible names to screen readers To provide markup with accessible names, ensure every: - `input` has an associated `label`. - `button` and `a` have child text, or `aria-label` when text isn’t present. For example, an icon button with no visible text. - `img` has an `alt` attribute. - `fieldset` has `legend` as its first child. - `figure` has `figcaption` as its first child. - `table` has `caption` as its first child. If the `label`, child text, or child element is not visually desired, use `.gl-sr-only` to hide the element from everything but screen readers. Ensure the accessible name is descriptive enough to be understood in isolation. ```html // bad page // good GitLab's accessibility page ``` ## Role In general, avoid using `role`. Use semantic HTML elements that implicitly have a `role` instead. | Bad | Good | | --- | --- | | `
` | `