decor
Assign empty alt attributes to decorative images so they can safely be ignored by assistive technologies, making your content clearer and more inclusive for everyone.
Usage
No custom fields or extra markup needed. Just add the js-decor class to any container element in your Twig templates (hero, card or teaser).
Every <img> inside the container will be treated as decorative, with no setup needed. The module will instantly apply empty alt attributes, role="presentation" and remove title attributes to mark images as decorative and removing them from the accessibility tree.
WCAG
This module helps you with WCAG Technique H67: Using null alt text and no title attribute on img elements for images that assistive technology should ignore for meeting Success Criterion 1.1.1: Non-text Content (Level A).
Issues in core
- [META] Improve workflows for image alternative text
- According to the WCAG guidelines decorative images should not have an alt-text but this is not possible
- Difficult for authors to embed image media with empty alt text