Twenty Thirteen: make small-screen menu accessible to keyboard commands and voice-driven software by using a focusable `button` element rather than `h3` for the toggle element. Fixes #28293, props rclations and obenland.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2014-07-15 23:10:15 +00:00
parent 5ff77be200
commit f2adf04025
2 changed files with 20 additions and 1 deletions

View File

@ -40,7 +40,7 @@
<div id="navbar" class="navbar">
<nav id="site-navigation" class="navigation main-navigation" role="navigation">
<h3 class="menu-toggle"><?php _e( 'Menu', 'twentythirteen' ); ?></h3>
<button class="menu-toggle"><?php _e( 'Menu', 'twentythirteen' ); ?></button>
<a class="screen-reader-text skip-link" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentythirteen' ); ?>"><?php _e( 'Skip to content', 'twentythirteen' ); ?></a>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
<?php get_search_form(); ?>

View File

@ -2853,9 +2853,22 @@ footer.entry-meta {
display: inline-block;
font: bold 16px/1.3 "Source Sans Pro", Helvetica, sans-serif;
margin: 0;
}
.menu-toggle,
.menu-toggle:hover,
.menu-toggle:focus,
.menu-toggle:active {
background: none;
border: none;
color: #141412;
padding: 12px 0 12px 20px;
}
.menu-toggle:focus {
outline: thin dotted;
}
.menu-toggle:after {
content: "\f502";
font-size: 12px;
@ -2908,6 +2921,12 @@ footer.entry-meta {
color: #fff;
}
.toggled-on .nav-menu > li a:focus,
.toggled-on .nav-menu > ul a:focus {
background-color: #220e10;
color: #fff;
}
ul.nav-menu,
div.nav-menu > ul {
display: none;