Twenty Seventeen: Change tag cloud format to a list (<ul>) for better semantics and accessibility.

List markup allows screen reader users to know in advance how many tags are within the list.

Props sami.keijonen.
Fixes #40184.
Built from https://develop.svn.wordpress.org/trunk@41703


git-svn-id: http://core.svn.wordpress.org/trunk@41537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2017-10-03 12:17:46 +00:00
parent 369ad06c82
commit f67678b59a
3 changed files with 30 additions and 8 deletions

View File

@ -541,6 +541,24 @@ function twentyseventeen_front_page_template( $template ) {
}
add_filter( 'frontpage_template', 'twentyseventeen_front_page_template' );
/**
* Modify tag cloud widget arguments to display all tags in the same font size
* and use list format for better accessibility.
*
* @since Twenty Seventeen 1.4
*
* @param array $args Arguments for tag cloud widget.
* @return array The filtered arguments for tag cloud widget.
*/
function twentyseventeen_widget_tag_cloud_args( $args ) {
$args['largest'] = 1;
$args['smallest'] = 1;
$args['unit'] = 'em';
$args['format'] = 'list';
return $args;
}
add_filter( 'widget_tag_cloud_args', 'twentyseventeen_widget_tag_cloud_args' );
/**
* Implement the Custom Header feature.
*/

View File

@ -2540,7 +2540,7 @@ h2.widget-title {
padding: 0.5em 0;
}
.widget ul li + li {
.widget:not(.widget_tag_cloud) ul li + li {
margin-top: -1px;
}
@ -2733,6 +2733,14 @@ h2.widget-title {
/* Tag cloud widget */
.tagcloud ul li {
float: left;
border-top: 0;
border-bottom: 0;
padding: 0;
margin: 4px 4px 0 0;
}
.tagcloud,
.widget_tag_cloud,
.wp_widget_tag_cloud {
@ -2745,12 +2753,8 @@ h2.widget-title {
border: 1px solid #ddd;
-webkit-box-shadow: none;
box-shadow: none;
display: inline-block;
float: left;
font-size: 14px !important; /* !important to overwrite inline styles */
font-size: 0.875rem !important;
margin: 4px 4px 0 0 !important;
padding: 4px 10px 5px !important;
display: block;
padding: 4px 10px 5px;
position: relative;
-webkit-transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out;
transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out;

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-alpha-41702';
$wp_version = '4.9-alpha-41703';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.