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

fix(a11y): home and expand icons in sidebar #1632

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion sphinx_rtd_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
{# the master_doc variable was renamed to root_doc in Sphinx 4 (master_doc still exists in later Sphinx versions) #}
{%- set _logo_url = logo_url|default(pathto('_static/' + (logo or ""), 1)) %}
{%- set _root_doc = root_doc|default(master_doc) %}
<a href="{{ pathto(_root_doc) }}"{% if not theme_logo_only %} class="icon icon-home"{% endif %}>
<a href="{{ pathto(_root_doc) }}"{% if not theme_logo_only %} aria-label="Go to Homepage" class="icon icon-home"{% endif %}>
{% if not theme_logo_only %}{{ project }}{% endif %}
{%- if logo or logo_url %}
<img src="{{ _logo_url }}" class="logo" alt="{{ _('Logo') }}"/>
Expand Down
2 changes: 1 addition & 1 deletion sphinx_rtd_theme/static/js/theme.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function ThemeNav () {
$('.wy-menu-vertical ul').not('.simple').siblings('a').each(function () {
var link = $(this);
expand =
$('<button class="toctree-expand" title="Open/close menu"></button>');
$('<button class="toctree-expand" title="Open/close menu" role="presentation"></button>');
expand.on('click', function (ev) {
self.toggleCurrent(link);
ev.stopPropagation();
Expand Down