Accessibility: bump headings one level up on the Appearance > Widgets screen for a better headings hierarchy.

Props mrahmadawais, afercia.
Fixes #33659.

git-svn-id: https://develop.svn.wordpress.org/trunk@35015 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrea Fercia 2015-10-10 16:33:33 +00:00
parent 5e85a8b55a
commit 52c2492afb
5 changed files with 17 additions and 8 deletions

View File

@ -419,7 +419,11 @@ body.adding-widget .add-new-widget:before {
box-shadow: none; box-shadow: none;
} }
#available-widgets .widget-title h4 { #customize-controls .widget-title h3 {
font-size: 1em;
}
#available-widgets .widget-title h3 {
padding: 0 0 5px; padding: 0 0 5px;
font-size: 14px; font-size: 14px;
} }
@ -621,7 +625,7 @@ body.adding-widget #customize-preview {
.last-widget { .last-widget {
margin-bottom: 15px; margin-bottom: 15px;
} }
.widget-title h4 { .widget-title h3 {
padding: 13px 15px; padding: 13px 15px;
} }
.widget-top a.widget-action:after { .widget-top a.widget-action:after {

View File

@ -22,9 +22,11 @@
text-decoration: none; text-decoration: none;
} }
.widget-title h3,
.widget-title h4 { .widget-title h4 {
margin: 0; margin: 0;
padding: 15px; padding: 15px;
font-size: 1em;
line-height: 1; line-height: 1;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
@ -100,6 +102,7 @@
cursor: pointer; cursor: pointer;
} }
.sidebar-name h2,
.sidebar-name h3 { .sidebar-name h3 {
margin: 0; margin: 0;
padding: 8px 10px; padding: 8px 10px;
@ -142,6 +145,7 @@ div#widgets-left .inactive-sidebar.closed .sidebar-name {
margin-bottom: 10px; margin-bottom: 10px;
} }
div#widgets-left .sidebar-name h2,
div#widgets-left .sidebar-name h3 { div#widgets-left .sidebar-name h3 {
padding: 10px 0; padding: 10px 0;
margin: 0 10px 0 0; margin: 0 10px 0 0;
@ -243,6 +247,7 @@ div#widgets-right .sidebar-description {
margin-top: -5px; margin-top: -5px;
} }
div#widgets-right .sidebar-name h2,
div#widgets-right .sidebar-name h3 { div#widgets-right .sidebar-name h3 {
padding: 15px 7px; padding: 15px 7px;
} }

View File

@ -81,7 +81,7 @@ function wp_list_widget_controls( $sidebar, $sidebar_name = '' ) {
?> ?>
<div class="sidebar-name"> <div class="sidebar-name">
<div class="sidebar-name-arrow"><br /></div> <div class="sidebar-name-arrow"><br /></div>
<h3><?php echo esc_html( $sidebar_name ); ?> <span class="spinner"></span></h3> <h2><?php echo esc_html( $sidebar_name ); ?> <span class="spinner"></span></h2>
</div> </div>
<?php <?php
} }
@ -226,7 +226,7 @@ function wp_widget_control( $sidebar_args ) {
<span class="screen-reader-text"><?php echo $widget_title; ?></span> <span class="screen-reader-text"><?php echo $widget_title; ?></span>
</a> </a>
</div> </div>
<div class="widget-title"><h4><?php echo $widget_title ?><span class="in-widget-title"></span></h4></div> <div class="widget-title"><h3><?php echo $widget_title; ?><span class="in-widget-title"></span></h3></div>
</div> </div>
<div class="widget-inside"> <div class="widget-inside">

View File

@ -297,7 +297,7 @@ wpWidgets = {
if ( ui.draggable.hasClass('ui-sortable-helper') ) { if ( ui.draggable.hasClass('ui-sortable-helper') ) {
$('#removing-widget').show().children('span') $('#removing-widget').show().children('span')
.html( ui.draggable.find('div.widget-title').children('h4').html() ); .html( ui.draggable.find( 'div.widget-title' ).children( 'h3' ).html() );
} }
}, },
out: function(e,ui) { out: function(e,ui) {
@ -310,7 +310,7 @@ wpWidgets = {
// Area Chooser // Area Chooser
$( '#widgets-right .widgets-holder-wrap' ).each( function( index, element ) { $( '#widgets-right .widgets-holder-wrap' ).each( function( index, element ) {
var $element = $( element ), var $element = $( element ),
name = $element.find( '.sidebar-name h3' ).text(), name = $element.find( '.sidebar-name h2' ).text(),
id = $element.find( '.widgets-sortables' ).attr( 'id' ), id = $element.find( '.widgets-sortables' ).attr( 'id' ),
li = $('<li tabindex="0">').text( $.trim( name ) ); li = $('<li tabindex="0">').text( $.trim( name ) );

View File

@ -244,7 +244,7 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) {
<div class="wrap"> <div class="wrap">
<h1><?php echo esc_html( $title ); ?></h1> <h1><?php echo esc_html( $title ); ?></h1>
<div class="editwidget"<?php echo $width; ?>> <div class="editwidget"<?php echo $width; ?>>
<h3><?php printf( __( 'Widget %s' ), $name ); ?></h3> <h2><?php printf( __( 'Widget %s' ), $name ); ?></h2>
<form action="widgets.php" method="post"> <form action="widgets.php" method="post">
<div class="widget-inside"> <div class="widget-inside">
@ -361,7 +361,7 @@ do_action( 'widgets_admin_page' ); ?>
<div id="available-widgets" class="widgets-holder-wrap"> <div id="available-widgets" class="widgets-holder-wrap">
<div class="sidebar-name"> <div class="sidebar-name">
<div class="sidebar-name-arrow"><br /></div> <div class="sidebar-name-arrow"><br /></div>
<h3><?php _e('Available Widgets'); ?> <span id="removing-widget"><?php _ex('Deactivate', 'removing-widget'); ?> <span></span></span></h3> <h2><?php _e( 'Available Widgets' ); ?> <span id="removing-widget"><?php _ex( 'Deactivate', 'removing-widget' ); ?> <span></span></span></h2>
</div> </div>
<div class="widget-holder"> <div class="widget-holder">
<div class="sidebar-description"> <div class="sidebar-description">