Skip to content

Commit

Permalink
Add aria label to breadcrumb links. Closes #172.
Browse files Browse the repository at this point in the history
  • Loading branch information
mejiaj committed Jan 14, 2025
1 parent 59c8ca9 commit a50c716
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/_includes/zebra/breadcrumb.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
Used in zebra testing layout: `src/_layouts/zebra.html`.
{% endcomment %}

{% assign link_aria_label = link_aria-_label | default: "Breadcrumb link" %}

<nav class="usa-breadcrumb usa-breadcrumb--wrap" aria-label="Breadcrumbs">
<ol class="usa-breadcrumb__list">
<!-- Home link. -->
<li class="usa-breadcrumb__list-item">
<a href="" class="usa-breadcrumb__link"><span>Home</span></a>
<a href="" class="usa-breadcrumb__link" aria-label="{{ link_aria_label }}">
<span>Home</span>
</a>
</li>

<!-- Autogenerated links from frontmatter. -->
Expand All @@ -28,7 +32,8 @@
<a
href="{{ breadcrumb_href }}"
class="usa-breadcrumb__link"
{% if item.current %}aria-current="page"{% endif %}>
{% if item.current %}aria-current="page"{% endif %}
aria-label="{{ link_aria_label }}">
<span>{{ item.label }}</span>
</a>
</li>
Expand Down

0 comments on commit a50c716

Please sign in to comment.