Twenty Fourteen: make small-screen menu accessible to keyboard commands and voice-driven software by using a focusable `button` element rather than `h1` for the toggle element. Fixes #27147, props jartes and joedolson.

Built from https://develop.svn.wordpress.org/trunk@27594


git-svn-id: http://core.svn.wordpress.org/trunk@27437 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2014-03-18 22:37:15 +00:00
parent 480fad1f82
commit ab92971817
2 changed files with 16 additions and 2 deletions

View File

@ -49,7 +49,7 @@
</div>
<nav id="primary-navigation" class="site-navigation primary-navigation" role="navigation">
<h1 class="menu-toggle"><?php _e( 'Primary Menu', 'twentyfourteen' ); ?></h1>
<button class="menu-toggle"><?php _e( 'Primary Menu', 'twentyfourteen' ); ?></button>
<a class="screen-reader-text skip-link" href="#content"><?php _e( 'Skip to content', 'twentyfourteen' ); ?></a>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
</nav>

View File

@ -820,7 +820,7 @@ span + .edit-link:before,
*/
/* Ensure that there is no gap between the header and
the admin bar for WordPress versions before 3.8. */
the admin bar for WordPress versions before 3.8. */
#wpadminbar {
min-height: 32px;
}
@ -986,11 +986,14 @@ span + .edit-link:before,
}
.menu-toggle {
background-color: #000;
border-radius: 0;
cursor: pointer;
font-size: 0;
height: 48px;
margin: 0;
overflow: hidden;
padding: 0;
position: absolute;
top: 0;
right: 0;
@ -1001,9 +1004,20 @@ span + .edit-link:before,
.menu-toggle:before {
color: #fff;
content: "\f419";
display: inline;
margin-top: 16px;
}
.menu-toggle:active,
.menu-toggle:focus,
.menu-toggle:hover {
background-color: #444;
}
.menu-toggle:focus {
outline: 1px dotted;
}
/**
* 6.0 Content