localgov icon indicating copy to clipboard operation
localgov copied to clipboard

Allow images to be marked as decorative

Open msayoung opened this issue 2 years ago • 4 comments

From @Gemma-inv :

In my most recent accessibility user testing I spoke to a blind user about his frustration with unrelated image alt text breaking up the flow of focussing on content. With that in mind we are currently working with a customer to devise a user friendly way for content editors to label something as decorative - similar to the image example - Second option down 'choose an option' - 'Alt text' or 'Decorative Image'. Just wondering if anyone here has thoughts on this or has created something similar.

image image

msayoung avatar Feb 17 '23 11:02 msayoung

Copying in the relevant Slack chat :)

Mark Conroy (Annertech) 32 minutes ago This is a little tricky given how media is set up in Drupal. Since media is reusable, allowing the same image to be placed in more than one place on the site, an image could be decorative in one setting but part of the content in another. We’d need to have a field beside each image field to say “in this instance, I want this image to be X or Y”. It’s not impossible.

Maria (Agile Collective) 21 minutes ago That very point makes for a bit of an accessibility issue in itself really, as the alt text might change depending on the context that you are using the image. Go down the rabbit hole here: https://webaim.org/techniques/alttext/ Maybe we could set alt text on the media item, then override it when we use it somewhere (in the image paragraph). That would have the upside of forcing people to add alt text and then mark it as decorative in a considered way, rather than just leaving it blank.

Gemma Bates (Invuse) 12 minutes ago I think the idea of making alt text required but marking as decorative on a case by case is a good solution.

msayoung avatar Feb 17 '23 11:02 msayoung

None of the below are the right solution, but are interesting nonetheless.

https://www.drupal.org/project/decorative_image_widget https://github.com/c-e-mah/blur_no_alt

There are vibrant discussions happening around CKEditor 5 which is coming in Drupal 10: https://www.drupal.org/project/drupal/issues/3222757#comment-14384063

And some interesting thoughts here too: https://accessibilitycluster.com/main-results/text-alternative-feature-%E2%80%93-presentation

msayoung avatar Feb 17 '23 14:02 msayoung

See also #394

andybroomfield avatar Feb 17 '23 15:02 andybroomfield

Flagging this again as it came up in the accessibility audit - specifically in relation to teasers in event listings and similar.

msayoung avatar Apr 16 '25 12:04 msayoung