Skip to content

Commit aaadcee

Browse files
fix: making it accessible
1 parent cb5a0f3 commit aaadcee

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

packages/components/bolt-pagination/pagination.twig

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
{% if current %} current="{{ current }}" {% endif %}
2121
{{ attributes }}
2222
>
23-
<nav class="{{ baseClass }}">
23+
<nav class="{{ baseClass }}" role="navigation" aria-label="Pagination Navigation">
2424
{% if previous %}
2525
<a class="{{ "#{baseClass}__item" }} {{ "#{baseClass}__item--prev" }}" href="{{ previous.href }}">
2626
<span class="{{ "#{baseClass}__icon" }}">
@@ -34,11 +34,25 @@
3434

3535
{% if pages %}
3636
{% for key, link in pages %}
37-
<a class="{{ "#{baseClass}__item" }} {{ key == current ? 'is-current' : '' }}" href="{{ link.href }}">
38-
<span class="{{ "#{baseClass}__text" }}">
39-
{{- key -}}
40-
</span>
41-
</a>
37+
{% if key == current %}
38+
<a class="{{ "#{baseClass}__item" }} is-current" href="{{ link.href }}" aria-current="true">
39+
<span class="{{ "#{baseClass}__text" }}">
40+
<span class="u-bolt-visuallyhidden">
41+
You are currently on page
42+
</span>
43+
{{- key -}}
44+
</span>
45+
</a>
46+
{% else %}
47+
<a class="{{ "#{baseClass}__item" }}" href="{{ link.href }}">
48+
<span class="{{ "#{baseClass}__text" }}">
49+
<span class="u-bolt-visuallyhidden">
50+
Navigate to page
51+
</span>
52+
{{- key -}}
53+
</span>
54+
</a>
55+
{% endif %}
4256
{% endfor %}
4357
{% endif %}
4458

0 commit comments

Comments
 (0)