gitea
gitea copied to clipboard
Many images don't have an alt attribute
Description
Currently, we have about 100 images that don't have an alt attribute (see below how that was calculated). This is not the best idea for accessibility, i.e. in case the browser blocks the images, the internet connection is not good enough to load the pictures, the user uses a screen reader, …
Hence, we should probably add an alt tag for every icon and image.
The only question is: Do we translate (all | some | no) alt attributes? Do we always use the English version? In favor of not translating would be the reduced effort to fix the problem and smaller binary size / file size. Against it is that users probably want it translated.
So, what approach should we choose?
Screenshots
Use ag '<img' | grep -v 'alt'
for a good estimate of where alt attributes are missing.
Gitea Version
1.18.0+dev-198-g4f14c6de1
Can you reproduce the bug on the Gitea demo site?
Yes
Operating System
Irrelevant
Browser Version
Irrelevant
The only question is: Do we translate (all | some | no) alt attributes? Do we always use the English version? In favor of not translating would be the reduced effort to fix the problem and smaller binary size / file size. Against it is that users probably want it translated.
It depends. I see a lot of logo's those just should be "{logo name} logo".
Some of them are loading/failed (for migration) images. They add no value for those using alt, so rather should be aria-hidden I assume.
Anything should and could be either provided a static alt or aria-hidden
. As I don't see any that depend on user-provided content.
Chiming in to say that images that are purely decorational should have an empty alt tag for assistive technologies. For example in repository Settings > Webhooks, there's a dropdown for adding new webhooks that lists 3rd party services with their logos. The logos in this case seem purely decorational since the service's name is right next to it. It's similar to the W3C's example 2.