Problem/Motivation
The logo and site-name links in the the SystemBrandingBlock have a useless title attribute
This is the code in the block--system-branding-block.html.twig
templates (approximately, some have classes etc).
{% if site_logo %}
<a href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home">
<img src="{{ site_logo }}" alt="{{ 'Home'|t }}" />
</a>
{% endif %}
That duplication of title and link content (alt tag in this case) is recommended against.
Depending on screen reader configuration etc, it may cause duplication in playback, and in any case provides no additional value.
- Using the HTML title attribute – updated
- The Trials and Tribulations of the Title Attribute
- Tenon Research First Glimpse: The Best & Worst Of Content Management Systems.. This article explicitly criticizes Drupal for this.
- The Title Attribute and Why It’s Almost Useless
Proposed resolution
Remove the title attribute from links in the System Branding Block templates.
Include the Bartik, Classy and Stable themes in this update, as this is a low-risk change/no class changes. Include the change to the Umami theme/demo as no risk there and the demo should be as accessible as possible.
Remaining tasks
Check with a front-end framework manager about updating Stable and Classy themes.
Remove the title attribute from these templates.
- core/modules/system/templates/block--system-branding-block.html.twig
- core/profiles/demo_umami/themes/umami/templates/components/branding/block--system-branding-block.html.twig
- core/themes/stable/templates/block/block--system-branding-block.html.twig
- core/themes/classy/templates/block/block--system-branding-block.html.twig
- core/themes/bartik/templates/block--system-branding-block.html.twig
User interface changes
Removes the title attribute from links in the System Branding Block templates.
API changes
None
Data model changes
None