Skip to content
Permalink
Browse files

Twenty Nineteen: Fixes and improvements.

This commit brings over several changes that occurred upstream in the theme’s GitHub repository into core.

- Fix the gallery caption link color. WordPress/twentynineteen#687
- Remove left padding from pullquote blocks. WordPress/twentynineteen#690
- Print `skip-link-focus-fix` inline instead of enqueueing as blocking script. WordPress/twentynineteen#47
- Fix and improve some strings with placeholders. WordPress/twentynineteen#217

Props kjellr, allancole, dimadin, westonruter.

See #45424.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@44196 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
desrosj committed Dec 14, 2018
1 parent afa8ba3 commit 6d78174aebffa4f9ccb9c5d92a64d381d1ff192f
@@ -51,7 +51,6 @@ protected function html5_comment( $comment, $depth, $args ) {
* fill color to the inner check shape when in circle form.
*/
if ( twentynineteen_is_comment_by_post_author( $comment ) ) {
/* translators: %s: SVG Icon */
printf( '<span class="post-author-badge" aria-hidden="true">%s</span>', twentynineteen_get_icon_svg( 'check', 24 ) );
}
@@ -110,5 +109,4 @@ protected function html5_comment( $comment, $depth, $args ) {
?>
<?php
}
}
@@ -221,8 +221,6 @@ function twentynineteen_scripts() {
wp_style_add_data( 'twentynineteen-style', 'rtl', 'replace' );
wp_enqueue_script( 'twentynineteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true );
if ( has_nav_menu( 'menu-1' ) ) {
wp_enqueue_script( 'twentynineteen-priority-menu', get_theme_file_uri( '/js/priority-menu.js' ), array(), '1.0', true );
wp_enqueue_script( 'twentynineteen-touch-navigation', get_theme_file_uri( '/js/touch-keyboard-navigation.js' ), array(), '1.0', true );
@@ -236,6 +234,24 @@ function twentynineteen_scripts() {
}
add_action( 'wp_enqueue_scripts', 'twentynineteen_scripts' );
/**
* Fix skip link focus in IE11.
*
* This does not enqueue the script because it is tiny and because it is only for IE11,
* thus it does not warrant having an entire dedicated blocking script being loaded.
*
* @link https://git.io/vWdr2
*/
function twentynineteen_skip_link_focus_fix() {
// The following is minified via `terser --compress --mangle -- js/skip-link-focus-fix.js`.
?>
<script>
/(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())},!1);
</script>
<?php
}
add_action( 'wp_print_footer_scripts', 'twentynineteen_skip_link_focus_fix' );
/**
* Enqueue supplemental block editor styles.
*/
@@ -40,8 +40,8 @@ function twentynineteen_posted_on() {
*/
function twentynineteen_posted_by() {
printf(
'<span class="byline">%1$s<span class="screen-reader-text">%2$s</span><span class="author vcard"><a class="url fn n" href="%3$s">%4$s</a></span></span>',
/* translators: 1: SVG icon. 2: post author, only visible to screen readers. 3: author link. */
'<span class="byline">%1$s<span class="screen-reader-text">%2$s</span><span class="author vcard"><a class="url fn n" href="%3$s">%4$s</a></span></span>',
twentynineteen_get_icon_svg( 'person', 16 ),
__( 'Posted by', 'twentynineteen' ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
@@ -85,8 +85,8 @@ function twentynineteen_entry_footer() {
/* translators: used between list items, there is a space after the comma. */
$categories_list = get_the_category_list( __( ', ', 'twentynineteen' ) );
if ( $categories_list ) {
/* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of categories. */
printf(
/* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of categories. */
'<span class="cat-links">%1$s<span class="screen-reader-text">%2$s</span>%3$s</span>',
twentynineteen_get_icon_svg( 'archive', 16 ),
__( 'Posted in', 'twentynineteen' ),
@@ -97,8 +97,8 @@ function twentynineteen_entry_footer() {
/* translators: used between list items, there is a space after the comma. */
$tags_list = get_the_tag_list( '', __( ', ', 'twentynineteen' ) );
if ( $tags_list ) {
/* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of tags. */
printf(
/* translators: 1: SVG icon. 2: posted in label, only visible to screen readers. 3: list of tags. */
'<span class="tags-links">%1$s<span class="screen-reader-text">%2$s </span>%3$s</span>',
twentynineteen_get_icon_svg( 'tag', 16 ),
__( 'Tags:', 'twentynineteen' ),
@@ -3,6 +3,8 @@
*
* Helps with accessibility for keyboard only users.
*
* This is the source file for what is minified in the twentynineteen_skip_link_focus_fix() PHP function.
*
* Learn more: https://git.io/vWdr2
*/
( function() {
@@ -324,6 +324,7 @@
margin-top: calc(4 * #{ $size__spacing-unit});
margin-bottom: calc(4.33 * #{ $size__spacing-unit});
margin-right: 0;
padding-left: 0;
}

p {
@@ -578,6 +579,10 @@
.blocks-gallery-item:last-child {
margin-bottom: 16px;
}

figcaption a {
color: #fff;
}
}

//! Captions
@@ -27,7 +27,8 @@
// Parent post navigation.
the_post_navigation(
array(
'prev_text' => _x( '<span class="meta-nav">Published in</span><br/><span class="post-title">%title</span>', 'Parent post link', 'twentynineteen' ),
/* translators: %s: parent post link */
'prev_text' => sprintf( __( '<span class="meta-nav">Published in</span><span class="post-title">%s</span>', 'twentynineteen' ), '%title' ),
)
);
} elseif ( is_singular( 'post' ) ) {
@@ -3765,6 +3765,7 @@ body.page .main-navigation {
margin-top: calc(4 * 1rem);
margin-bottom: calc(4.33 * 1rem);
margin-left: 0;
padding-right: 0;
}

.entry .entry-content .wp-block-pullquote p {
@@ -4047,6 +4048,10 @@ body.page .main-navigation {
margin-bottom: 16px;
}

.entry .entry-content .wp-block-gallery figcaption a {
color: #fff;
}

.entry .entry-content .wp-block-audio figcaption,
.entry .entry-content .wp-block-video figcaption,
.entry .entry-content .wp-block-image figcaption,
@@ -3777,6 +3777,7 @@ body.page .main-navigation {
margin-top: calc(4 * 1rem);
margin-bottom: calc(4.33 * 1rem);
margin-right: 0;
padding-left: 0;
}

.entry .entry-content .wp-block-pullquote p {
@@ -4059,6 +4060,10 @@ body.page .main-navigation {
margin-bottom: 16px;
}

.entry .entry-content .wp-block-gallery figcaption a {
color: #fff;
}

.entry .entry-content .wp-block-audio figcaption,
.entry .entry-content .wp-block-video figcaption,
.entry .entry-content .wp-block-image figcaption,
@@ -10,6 +10,7 @@
if ( (bool) get_the_author_meta( 'description' ) ) : ?>
<div class="author-bio">
<h2 class="author-title">
<?php /* translators: %s: author name */ ?>
<span class="author-heading"><?php echo esc_html( sprintf( __( 'Published by %s', 'twentynineteen' ), get_the_author() ) ); ?></span>
</h2>
<p class="author-description">

0 comments on commit 6d78174

Please sign in to comment.
You can’t perform that action at this time.