mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-12 21:03:32 -06:00
Add ARIA roles and labels to search, header, logo, mobile menu button, and main content (#1259)
This PR fixes several Axe errors I found while working on https://viewcomponent.org/. I did not see any visual regressions on my deploy, but I'd encourage testing with other sites. --------- Co-authored-by: Lindsey Wild <35239154+lindseywild@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{% capture search_placeholder %}{% include search_placeholder_custom.html %}{% endcapture %}
|
||||
|
||||
<div class="search">
|
||||
<div class="search" role="search">
|
||||
<div class="search-input-wrap">
|
||||
<input type="text" id="search-input" class="search-input" tabindex="0" placeholder="{{ search_placeholder | strip_html | strip }}" aria-label="{{ search_placeholder | strip_html| strip }}" autocomplete="off">
|
||||
<label for="search-input" class="search-label"><svg viewBox="0 0 24 24" class="search-icon"><use xlink:href="#svg-search"></use></svg></label>
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<div class="side-bar">
|
||||
<div class="site-header">
|
||||
<div class="site-header" role="banner">
|
||||
<a href="{{ '/' | relative_url }}" class="site-title lh-tight">{% include title.html %}</a>
|
||||
<a href="#" id="menu-button" class="site-button">
|
||||
<svg viewBox="0 0 24 24" class="icon"><use xlink:href="#svg-menu"></use></svg>
|
||||
<button id="menu-button" class="site-button" aria-label="Open menu">
|
||||
<svg viewBox="0 0 24 24" class="icon" aria-hidden="true"><use xlink:href="#svg-menu"></use></svg>
|
||||
</a>
|
||||
</div>
|
||||
<nav aria-label="Main" id="site-nav" class="site-nav">
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{% if site.logo %}
|
||||
<div class="site-logo"></div>
|
||||
<div class="site-logo" role="img" aria-label="{{ site.title }}"></div>
|
||||
{% else %}
|
||||
{{ site.title }}
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user