Twenty Twelve: 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 #28224, props rclations.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2014-07-11 17:47:14 +00:00
parent 0fd758458c
commit f5df1e4859
4 changed files with 4 additions and 3 deletions

View File

@ -140,7 +140,7 @@ function twentytwelve_scripts_styles() {
wp_enqueue_script( 'comment-reply' );
// Adds JavaScript for handling the navigation menu hide-and-show behavior.
wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20140608', true );
wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20140711', true );
$font_url = twentytwelve_get_font_url();
if ( ! empty( $font_url ) )

View File

@ -40,7 +40,7 @@
</hgroup>
<nav id="site-navigation" class="main-navigation" role="navigation">
<h3 class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></h3>
<button class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></button>
<a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
</nav><!-- #site-navigation -->

View File

@ -8,7 +8,7 @@
return;
}
button = nav.getElementsByTagName( 'h3' )[0];
button = nav.getElementsByTagName( 'button' )[0];
menu = nav.getElementsByTagName( 'ul' )[0];
if ( ! button ) {
return;

View File

@ -272,6 +272,7 @@ input[disabled] {
cursor: default;
}
.menu-toggle:hover,
.menu-toggle:focus,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,