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. git-svn-id: https://develop.svn.wordpress.org/trunk@41703 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d2a011c666
commit
ef549c2b53
@ -541,6 +541,24 @@ function twentyseventeen_front_page_template( $template ) {
|
|||||||
}
|
}
|
||||||
add_filter( 'frontpage_template', 'twentyseventeen_front_page_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.
|
* Implement the Custom Header feature.
|
||||||
*/
|
*/
|
||||||
|
@ -2540,7 +2540,7 @@ h2.widget-title {
|
|||||||
padding: 0.5em 0;
|
padding: 0.5em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.widget ul li + li {
|
.widget:not(.widget_tag_cloud) ul li + li {
|
||||||
margin-top: -1px;
|
margin-top: -1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2733,6 +2733,14 @@ h2.widget-title {
|
|||||||
|
|
||||||
/* Tag cloud widget */
|
/* Tag cloud widget */
|
||||||
|
|
||||||
|
.tagcloud ul li {
|
||||||
|
float: left;
|
||||||
|
border-top: 0;
|
||||||
|
border-bottom: 0;
|
||||||
|
padding: 0;
|
||||||
|
margin: 4px 4px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
.tagcloud,
|
.tagcloud,
|
||||||
.widget_tag_cloud,
|
.widget_tag_cloud,
|
||||||
.wp_widget_tag_cloud {
|
.wp_widget_tag_cloud {
|
||||||
@ -2745,12 +2753,8 @@ h2.widget-title {
|
|||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
-webkit-box-shadow: none;
|
-webkit-box-shadow: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
display: inline-block;
|
display: block;
|
||||||
float: left;
|
padding: 4px 10px 5px;
|
||||||
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;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
-webkit-transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out;
|
-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;
|
transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.3s ease-in-out;
|
||||||
|
Loading…
Reference in New Issue
Block a user