Skip to content

Add a class for detecting poor accessibility practices #174

Description

@geoffrey-eisenbarth

I think I got this idea from Katrina awhile back, but perhaps we should offer a class like <html class="debug"> that helps authors avoid some common accessibility pitfalls. The following is a copy/paste of my current styles, not necessarily the implementation we'd use:

article:not(:has(h1, h2, h3, h4, h5, h6)),
fieldset:not(:has(legend)),
figure:not(:has(figcaption)),
section:not([role]):not([aria-label], [aria-labelledby]),
form:not(search > form):not([aria-label], [aria-labelledby]),
table:not(:has(caption)):not([aria-label], [aria-labelledby]),
search > form:not([aria-label], [aria-labelledby]) {
  background: initial !important;
}
img:not([alt]) {
  filter: invert() !important;
}
label:not([for]),
input:not([name], [id]) {
  color: red !important;
}

.iconbutton:not([title], [aria-label]) {
  background: red !important;
  color: red !important;
}

.print-only:not([aria-hidden="true"]) {
  background: red !important;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions