Accessibility Check #1
Tags: a11y, html, javascript, testing
Published: 2022-07-29 19:47:00

Today I'm starting my very first accessibility check. I'll be auditing websites to see how well they implement accessibility and pointing out the problems and items that need improvement.

Until I get their approval, I won't show which websites I'm reviewing so as not to embarrass anyone and to give them a chance to update their website and make it more accessible after I send them my assessment.

## Table of content

1. [Accessibility Tools And How To Use Them](#chapter-1)
2. [Elements Must Have Sufficient Color Contrast](#chapter-2)
3. [`<html>` Element Must Have A Lang Attribute](#chapter-3)
4. [Links Must Have Discernible Text](#chapter-4)
5. [Next Steps](#chapter-5)

---

## 1. Accessibility Tools And How To Use Them<a name="chapter-1"></a>

- [Axe Devtool Extension](https://www.deque.com/axe/browser-extensions/)
- [WebAIM Color Contrast Checker](https://webaim.org/resources/contrastchecker/)

I test the website with the free axe DevTool extension, one of the best tools on the market.
After I run the extension, 40 automatic* issues are found.
These are divided into critical, serious, moderate and minor. The critical and serious issues are the most important ones to fix. Let's take a closer look and see what can be done to improve the website.

![40 critical issues found](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rc4xcizhe7l6vj84b5hr.png)

_*Automatic means that vulnerabilities are found using accessibility development tools. However, even if all the listed vulnerabilities are fixed, it doesn't necessarily mean that the website is now fully accessible. Manual testing is still required, using only the keyboard and going through the website with a screen reader, to really point out and fix all the problems._

## 2. Elements Must Have Sufficient Color Contrast<a name="chapter-2"></a>

Most of the serious problems were related to the color contrast. To easily find the errors on the website, you can highlight them by activating the "Highlight" button.

![Highlight the issue](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4463yimh4gx9n5ww00y4.png)

**Issue Description (by axe Devtools)**
Ensures the contrast between foreground and background colors meets WCAG2AA contrast ratio thresholds.

People with low vision may have difficulty reading the content due to the weak color contrast.

### Primary color

This button does not have sufficient color contrast (blue [HEX color value](https://www.w3schools.com/colors/colors_hexadecimal.asp) of #2FAFF5 on white HEX #FFFFFF). The WebAIMS Color Contrast Checker shows that the contrast ratio is only 2.45:1, which is quite low. To meet [WCAG2.1 AA](https://www.w3.org/TR/WCAG21/), the contrast ratio needs to be at least 4.5:1. The blue would have to be reduced to a brightness of 32% to achieve this ratio.

![Button with low color contrast](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ournfexsfdfd6ox2c8ew.png)

This color combination also causes three of the other problems.

### Neutral color 

The other two problems are caused by a gray tone used for the subheading.

![Subheading with low color contrast](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/an9x63wd0trtf2jjh3tb.png)

The gray (#737373) itself would suffice with a contrast ratio of 8.59:1 on a white (#FFFFFF) background, but an opacity of rgba(115, 115, 115, 0.74) has been set which weakens the contrast, to 2.95:1.

**How to solve**
Changing the primary color to a darker color and removing the opacity will solve this problem.

## 3. <html> Element Must Have A Lang Attribute<a name="chapter-3"></a>

It is important that a default language is set. Otherwise, screen readers will use the language selected by the operating system, which can sound quite awful and incomprehensible, for example, if you pronounce a German word in French, which the screen reader user might not expect.

**Issue Description**
Ensures every HTML document has a lang attribute.

**How to solve**
Adding the language of the website, in this case English, with the lang attribute.

```html
<html lang="en">
  <!--document head and body-->
</html>
```

If words or paragraphs are used in a language other than the default, you can also specify the language directly in this HTML tag.

```html
<p lang="es">Text in another language</p>
```

Here is a [list with all HTML Language Code References](https://www.w3schools.com/tags/ref_language_codes.asp).

## 4. Links Must Have Discernible Text<a name="chapter-4"></a>

The last serious problem concerns an anchor tag around the company logo in the top left header. 

**Issue Description**
Ensures links have discernible text.

```html
<a href="#" class="logo-link w-nav-brand">
  <img loading="lazy" src="https://logo.svg" alt="" class="image" />
</a>
```

The link around the logo leads nowhere when clicked. So the `a` tag is misused here. But I see how it is. The website was created with [Webflow](https://webflow.com/?r=0). So I'm assuming that they made Webflow do this as a default, because many websites link to their home page when you click on the logo, but that's not the case here.

And that is what is misleading. Screen reader users can tab to the logo because it's an `a` tag, so they assume something will happen when they click on it. Screen reader users don't get any further information in the "alt" attribute or via the aria-label that this is not a real link.

**How to solve**
The surrounding `a` tag should be removed.
The href attribute gets a destination to link to and a discernible text e.g. in the alt attribute of the image. This website is a single web page which means the links in the navbar are linking to section within the page (like home, about). The destination could be just the same as the one for the home section.

## 5. Next Steps<a name="chapter-5"></a>

I will contact the owner of the site and share my findings and tips, ask if changes can be made to make the web accessible to all, and of course offer my help if needed.

I will keep you updated.

**Update 08/14/2022:** I have received a positive feedback from the owner of the website. He and his web designer will look at the issues I listed and make necessary adjustments. Mission accomplished 🫡.

---
![Thank you](https://docs.google.com/uc?export=download&id=166Ecq6uBl61U14OUlkHOHIBv2ArKoumJ)

_Thanks for your reading and time. I really appreciate it!_