Problem/Motivation

  1. SVG images require the following elements and attributes:
    1. element or aria-label
    2. role=”img”
  2. These are used by screen reader users and non-mouse users

WCAG success criteria

1.3.1 Information and Relationships
4.1.2 Name, Role, Value

Steps to reproduce

  1. Open in mobile or desktop view
  2. Inspect the page in your browser
  3. Search for the <svg> code snippet below within the sidebar <aside>
  4. Verify that it’s missing the following:
    1. element (aka label)
    2. role=”img” attribute

Code snippet

<svg class="admin-toolbar__close-button-icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
<path …></path>
</svg>

Potential resolution

  1. Add <title> element with meaningful value, which provides a label for the SVG image
  2. Add role=”img”
  3. Look up the width and height of the SVG image
<svg role=”img” class="admin-toolbar__close-button-icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
	<title>Close admin toolbar</title>
<path …></path>
</svg>

Issue fork navigation-3395584

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ckrina created an issue. See original summary.

ckrina credited katannshaw.

ckrina credited pjudge.

ckrina’s picture

abhishek_gupta1’s picture

Assigned: Unassigned » abhishek_gupta1

abhishek_gupta1’s picture

Assigned: abhishek_gupta1 » Unassigned
Status: Active » Needs review

@ckrina, I have fixed the issue, Please kindly review the MR

finnsky’s picture

Status: Needs review » Needs work

Please also add translate.

abhishek_gupta1’s picture

Status: Needs work » Needs review
finnsky’s picture

Status: Needs review » Reviewed & tested by the community

LGTM!
Thank you!

ckrina’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all for the fixes!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.