Skip to content

Commit 854c9d4

Browse files
committed
Bundled Theme: A11y: Fix skip link in Twenty Ten.
Fix the source positioning of the skip link in Twenty Ten and add CSS for visibility on focus. Props anonymized_3085, iammattthomas, joedolson, sabernhardt, shailu25, mukesh27, poena. Fixes #14795. git-svn-id: https://develop.svn.wordpress.org/trunk@59857 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 00ae6b8 commit 854c9d4

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/wp-content/themes/twentyten/header.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
<body <?php body_class(); ?>>
6464
<?php wp_body_open(); ?>
6565
<div id="wrapper" class="hfeed">
66+
<?php // Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. ?>
67+
<a href="#content" class="screen-reader-text skip-link"><?php _e( 'Skip to content', 'twentyten' ); ?></a>
6668
<div id="header">
6769
<div id="masthead">
6870
<div id="branding" role="banner">
@@ -101,8 +103,6 @@
101103
</div><!-- #branding -->
102104

103105
<div id="access" role="navigation">
104-
<?php // Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. ?>
105-
<div class="skip-link screen-reader-text"><a href="#content"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div>
106106
<?php
107107
/*
108108
* Our navigation menu. If one isn't filled out, wp_nav_menu() falls back to wp_page_menu().

src/wp-content/themes/twentyten/style.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,21 @@ a:hover {
348348
width: 1px;
349349
}
350350

351+
a.skip-link:focus {
352+
background-color: #ddd;
353+
clip-path: none;
354+
color: #333;
355+
display: block;
356+
font-size: 16px;
357+
height: auto;
358+
left: 5px;
359+
line-height: 1.5;
360+
padding: 16px 24px;
361+
text-decoration: none;
362+
top: 5px;
363+
width: auto;
364+
z-index: 100000;
365+
}
351366

352367
/* =Header
353368
-------------------------------------------------------------- */

0 commit comments

Comments
 (0)