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

a few accessibility fixes from lighthouse report #1391

Merged
merged 10 commits into from Dec 18, 2019
1 change: 0 additions & 1 deletion src/assets/stylesheets/base/_icons.scss
Expand Up @@ -35,7 +35,6 @@
line-height: 1;
text-transform: none;
white-space: nowrap;
speak: none;
squidfunk marked this conversation as resolved.
Show resolved Hide resolved
word-wrap: normal;
direction: ltr;

Expand Down
4 changes: 2 additions & 2 deletions src/base.html
Expand Up @@ -145,7 +145,7 @@
href="https://fonts.googleapis.com/css?family={{
font.text | replace(' ', '+') + ':300,400,400i,700%7C' +
font.code | replace(' ', '+')
}}&display=fallback" />
}}&display=swap" />
Stanzilla marked this conversation as resolved.
Show resolved Hide resolved
<style>
body, input {
font-family: "{{ font.text }}", "Helvetica Neue",
Expand All @@ -165,7 +165,7 @@

<!-- Progressive Web App Manifest -->
{% if config.extra.manifest %}
<link rel="manifest" href="{{ config.extra.manifest | url }}">
<link rel="manifest" type="application/manifest+json" href="{{ config.extra.manifest | url }}" crossorigin="use-credentials">
squidfunk marked this conversation as resolved.
Show resolved Hide resolved
{% endif %}

<!-- Custom stylesheets -->
Expand Down
4 changes: 2 additions & 2 deletions src/partials/footer.html
Expand Up @@ -89,9 +89,9 @@
</div>
{% endif %}
powered by
<a href="https://www.mkdocs.org">MkDocs</a>
<a href="https://www.mkdocs.org" rel="noopener">MkDocs</a>
and
<a href="https://squidfunk.github.io/mkdocs-material/">
<a href="https://squidfunk.github.io/mkdocs-material/" rel="noopener">
Material for MkDocs</a>
</div>

Expand Down
3 changes: 2 additions & 1 deletion src/partials/header.html
Expand Up @@ -31,11 +31,12 @@
<div class="md-flex__cell md-flex__cell--shrink">
<a href="{{ config.site_url | default(nav.homepage.url, true) | url }}"
title="{{ config.site_name }}"
aria-label="{{ config.site_name }}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding an ARIA label + the alt tag on the image - how is this handled by screen readers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Windows Narrator just says "sitename" once.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And lighthouse complained about there missing a label to the a because the img inside of it was not enough, for whatever reason.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay great, so this is ready to merge?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes from my side!

class="md-header-nav__button md-logo">
{% if config.theme.logo.icon %}
<i class="md-icon">{{ config.theme.logo.icon }}</i>
{% else %}
<img src="{{ config.theme.logo | url }}" width="24" height="24" />
<img alt="logo" src="{{ config.theme.logo | url }}" width="24" height="24" />
{% endif %}
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/partials/nav.html
Expand Up @@ -30,7 +30,7 @@
{% if config.theme.logo.icon %}
<i class="md-icon">{{ config.theme.logo.icon }}</i>
{% else %}
<img src="{{ config.theme.logo | url }}" width="48" height="48" />
<img alt="logo" src="{{ config.theme.logo | url }}" width="48" height="48" />
{% endif %}
</a>
{{ config.site_name }}
Expand Down
2 changes: 1 addition & 1 deletion src/partials/search.html
Expand Up @@ -27,7 +27,7 @@
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query"
<input type="text" class="md-search__input" aria-label="search" name="query"
placeholder="{{ lang.t('search.placeholder') }}"
autocapitalize="off" autocorrect="off" autocomplete="off"
spellcheck="false" data-md-component="query"
Expand Down
2 changes: 1 addition & 1 deletion src/partials/social.html
Expand Up @@ -26,7 +26,7 @@
<link rel="stylesheet" type="text/css"
href="{{ 'assets/fonts/font-awesome.css' | url }}" />
{% for social in config.extra.social %}
<a href="{{ social.link }}" class="md-footer-social__link
<a href="{{ social.link }}" rel="noopener" title="{{ social.type }}" class="md-footer-social__link
Stanzilla marked this conversation as resolved.
Show resolved Hide resolved
fa fa-{{ social.type }}"></a>
{% endfor %}
</div>
Expand Down