Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various a11y fixes #181

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ const DesktopMenuItem = ({
className={cx('main-nav-desktop__item', {
'main-nav-desktop__item--current-section': item.is_current,
})}
aria-current={item.is_current ? 'page' : undefined}
>
<span>{item.title}</span>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ const MobileMenuItem = ({
/>
</button>
) : (
<a href={item.link_url} className="mobile-menu__nav-btn">
<a
href={item.link_url}
className="mobile-menu__nav-btn"
aria-current={item.is_current ? 'page' : undefined}
>
<span>{item.title}</span>
<Svg
sprite="two-tone"
Expand Down
2 changes: 1 addition & 1 deletion cdhweb/static_src/global/components/main-nav-desktop.scss
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
}

.main-nav-desktop__item--current-section {
border-color: var(--color-brand-40);
border-color: var(--color-brand-100);
}

.main-nav-desktop__dropdown-icon {
Expand Down
2 changes: 1 addition & 1 deletion cdhweb/static_src/global/mixins/three-dee-box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
}

& > * {
// Make content appear in front of 3d box's solid background
isolation: isolate;
z-index: 1;
}
}
7 changes: 5 additions & 2 deletions templates/includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@
class="main-nav-desktop__item
{% if request.path|starts_with:item.link_url %}
main-nav-desktop__item--current-section
{% endif %}
">
{% endif %}"
{% if request.path|starts_with:item.link_url and not item.l2_items.all %}
aria-current="page"
{% endif %}
>
<span>{{ item.title }}</span>
{# Reserve space for dropdown icon, to stop jank when the React version replaces this version. #}
{% if item.l2_items.all %}
Expand Down
2 changes: 1 addition & 1 deletion templates/includes/pagination.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

{# always display current page, marked as active #}
{% if number == page_obj.number %}
<a title="page {{number}}" class="pagination__item pagination__item--current" href="?{% url_replace 'page' number %}">{{ number }}</a>
<a title="page {{number}}" class="pagination__item pagination__item--current" href="?{% url_replace 'page' number %}" {% if number == page_obj.number %}aria-current="page"{% endif %}>{{ number }}</a>

{# for current page 1 or 2, display first 5 #}
{% elif page_obj.number <= 2 and number <= 5 %}
Expand Down
Loading