To check color contrast online, use the WebAIM contrast checker.
Did you know the Chrome DevTools come with a built-in accessibility color checker?
An important consideration for colorblind users is making sure that color isn't the only way users can tell if there is an error with the form. For example, a red ring is not enough. Consider adding an icon or an error label.
To simulate a number of visual impairments on any website, check out NoCoffee for Firefox
Helps neurological and also low vision (another curb cut example)
Remember to set the lang attribute both on the top level html tag as well as any sections where the language deviates from it.
Although it won't always have a user facing effect, it is recommended that you find and fix and validation or parsing errors in your HTML.
Users can set a "prefers reduced motion" setting in their operating system (Windows, Mac, Linux) and we can read that setting in CSS and swap out animations with more subtle effects.
This is important both as a preference and also to avoid causing issues for users who may suffer from seizures.
<div class="animation">animated box</div>
.animation {
animation: pulse 1s linear infinite both;
}
@media (prefers-reduced-motion) {
.animation {
animation-name: dissolve;
}
}
Another amazing API is one that allows us to detect if the user prefers a "light" or "dark" colorscheme.
<div class="wrapper">
...
</div>
@media (prefers-color-scheme: dark) {
.wrapper {
background: black;
}
}
@media (prefers-color-scheme: light) {
.wrapper {
background: white;
}
}
Let's read and set dark mode for our website in exercise 5.