A11y for Categories

Hello Team,

How are you doing?

I wanted to understand how do I setup alt text and aria-labels for category images?



There’s no option to add the aria-labels to the images, so it’s not a good idea to use these images for anything other than decoration.

The way the images are marked up now, it seems like a screen reader would say “graphic” and nothing more. We don’t have any current plans to add the option to setup alt text, but we should probably include that as an option in our image uploader at some point.

In the meantime we should add an empty alt tag there so it’s ignored completely instead of the unhelpful state it’s currently in.

It would be possible to add aria-labels to the markup using theme settings in a theme component, but it would be difficult if you’re unfamiliar with building Discourse themes (Developer’s guide to Discourse Themes).


I’ve merged in the empty alt tag fix



Thanks Chris. Could we have used Image title as alt text?

1 Like