This Website is Accessible

Welcome to my website showcasing several web accessibility features and implementations for web developers.

High Contrast

Use WCAG compliant color palettes to improve readability. All code snippets on the website uses a11y-light. You should have a 4.5:1 contrast between the text color and the background. As well as a 3:1 contrast between the link text color and the surrounding non-link text color.

  • 4.5:1 contrast between the non-link text color and the background.
  • 4.5:1 contrast between the link text color and the background.
  • 3:1 contrast between the link text color and the surrounding non-link text color.
Reference

Explicit Language Attribute

Specifying the intended language of the content of your website can help screen readers pronunciate more accurately.

1
<p lang="en-GB">British English</p>
Reference

Keyboard Navigation

Although you want your website to respect the accessibility features provided by the operating system. Implement custom keyboard navigation to help users who can't use pointer-based input if navigating your website is unreliable without one.

For example, you should be able to scroll with arrow keys on this page, that is default behavior, meaning people will expect this to happen when they press arrow keys. It can be confusing if it is rebinded to some other functionality.

Autofocus

Autofocus is often used in conjunction with forms and is performed the moment the user loads into the page. While autofocus spares users from an extra click and directs them to a starting location of your choice, visitors with screen readers might find it difficult to orient themselves within the layouts of your website as the focus changes without warning.

1
<!-- Use cautiously! -->
2
<input name="q" autofocus />
Reference

Unstyled List Quirks

Unstyled lists are not announced as lists by VoiceOver, you can fix this by specifying a role.

1
<ul role="list">
2
	<li>One</li>
3
	<li>Two</li>
4
	<li>Three</li>
5
</ul>

Which would render and appear as:

  • One
  • Two
  • Three
Reference

Text Alternatives for Images

Images can be productive representations of information, so it is not recommanded to remove images for the sake of accessibility. Instead, provide detailed explanations of the images so that it can be read by a screen reader or transcribed into Braille.

1
<img alt="describe the image"></img>
a concrete road in between two long rows of bushes and trees with golden leaves underneath the sun.

Alt Text: a concrete road in between two long rows of bushes and trees with golden leaves underneath the sun.

Reference

Avoid Visual-Dependent Elements

Most screen readers do not react when content changes dynamically. Additionally, for toggle buttons such as the one below, do not update the text within the buttons at all.

Please never do something like this.

At the very least specify an aria attribute to indicate the state.

1
<button aria-pressed="true||false">
2
	Toggle
3
</button>

Text Readability

Ensure that visitors to your site can read everything with ease. Choose a font with readability in mind, although most default fonts provided by browsers can fulfill that role.

Certain fonts may help users with dyslexia, such as OpenDyslexic under the SIL-OFL license.

The quick brown fox jumps over the lazy dog

Reference