These changes make the checkmark audibly accessible, but there’s a further consideration: dark mode. Right now, the check remains dusky blue but in dark mode appears on a dark blue background, meaning it lacks colour contrast:
One way to fix this would be to change the icon so that the tick is cutout of the circle, and then filling the icon with the colour of the surrounding text.
The new verified checkmark on web profiles includes the following markup:
Unfortunately, this checkmark is not accessible, and would likely not be announced by screen readers. To fix this, you can:
role="img"
so that it’s purpose can be correctly identified<title>
so that the graphic has an accessible name (this is the equivalent of addingalt
to<img>
)aria-labelledby
and point it to the<title>
.This gives you the following:
These changes make the checkmark audibly accessible, but there’s a further consideration: dark mode. Right now, the check remains dusky blue but in dark mode appears on a dark blue background, meaning it lacks colour contrast:
One way to fix this would be to change the icon so that the tick is cutout of the circle, and then filling the icon with the colour of the surrounding text.
Put all together, you’d end up with this:
And this is how it appears in dark mode:
and in light mode:
Less code, and yet more robust and accessible code 😀