Skip to content
This repository has been archived by the owner on Jan 18, 2019. It is now read-only.

Commit

Permalink
Merge pull request #8 from WordPress/master
Browse files Browse the repository at this point in the history
merge master back into fork
  • Loading branch information
fabiankaegy authored Oct 19, 2018
2 parents f254535 + 3b361b7 commit 924f4df
Show file tree
Hide file tree
Showing 23 changed files with 223 additions and 567 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ Version 1.0:
@westonruter
@aaronjorbin
@netweb
@b-07
@khleomix
6 changes: 3 additions & 3 deletions classes/class-twentynineteen-svg-icons.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?php
/**
* TODO: File doc comment.
* SVG Icons class
*
* @package WordPress
* @subpackage Twenty_Nineteen
*/

/**
* SVG Icons class.
*
* This class is in charge of displaying SVG icons across the site.
*
* Place each <svg> source on its own array key, without adding the
Expand All @@ -17,6 +15,8 @@
*
* All icons are assumed to have equal width and height, hence the option
* to only specify a `$size` parameter in the svg methods.
*
* @since 1.0.0
*/
class TwentyNineteen_SVG_Icons {

Expand Down
9 changes: 5 additions & 4 deletions classes/class-twentynineteen-walker-comment.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<?php
/**
* TODO: File doc comment.
* Custom comment walker for this theme
*
* @package WordPress
* @subpackage Twenty_Nineteen
*/

/**
* TODO: Class doc comment.
* This class outputs custom comment walker for HTML5 friendly WordPress comment and threaded replies.
*
* @since 1.0.0
*/
class TwentyNineteen_Walker_Comment extends Walker_Comment {

Expand Down Expand Up @@ -52,7 +54,6 @@ protected function html5_comment( $comment, $depth, $args ) {

/* translators: %s: comment author link */
printf(
/* translators: TODO comment on placeholders */
__( '%s <span class="screen-reader-text says">says:</span>' ),
sprintf( '<b class="fn">%s</b>', get_comment_author_link( $comment ) )
);
Expand All @@ -63,7 +64,7 @@ protected function html5_comment( $comment, $depth, $args ) {
<a href="<?php echo esc_url( get_comment_link( $comment, $args ) ); ?>">
<?php /* translators: 1: comment date, 2: comment time */ ?>
<time datetime="<?php comment_time( 'c' ); ?>" title="<?php printf( __( '%1$s at %2$s', 'twentynineteen' ), get_comment_date( '', $comment ), get_comment_time() ); ?>">
<?php echo twentynineteen_human_time_diff( get_comment_date( 'U' ) ); ?>
<?php printf( __( '%1$s at %2$s', 'twentynineteen' ), get_comment_date( '', $comment ), get_comment_time() ); ?>
</time>
</a>
<?php
Expand Down
2 changes: 1 addition & 1 deletion comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<?php
wp_list_comments(
array(
'walker' => new Twenty_Nineteen_Walker_Comment(),
'walker' => new TwentyNineteen_Walker_Comment(),
'avatar_size' => twentynineteen_get_avatar_size(),
'short_ping' => true,
'style' => 'ol',
Expand Down
1 change: 0 additions & 1 deletion footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<div class="site-info">
<a class="site-name" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>,
<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentynineteen' ) ); ?>" class="imprint">
<?php /* translators: TODO comment on placeholders */ ?>
<?php printf( __( 'Proudly powered by %s', 'twentynineteen' ), 'WordPress' ); ?>.
</a>
<?php
Expand Down
2 changes: 1 addition & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<?php if ( ! is_page() ) : ?>
<div class="<?php echo ( ! empty( $discussion ) && count( $discussion->authors ) > 0 ) ? 'entry-meta has-discussion' : 'entry-meta'; ?>">
<?php twentynineteen_posted_by(); ?>
<?php twentynineteen_estimated_read_time(); ?>
<?php twentynineteen_posted_on(); ?>
<span class="comment-count">
<?php
if ( ! empty( $discussion ) ) {
Expand Down
2 changes: 1 addition & 1 deletion inc/icon-functions.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* SVG icons related functions.
* SVG icons related functions
*
* @package WordPress
* @subpackage Twenty_Nineteen
Expand Down
2 changes: 1 addition & 1 deletion inc/template-functions.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Functions which enhance the theme by hooking into WordPress.
* Functions which enhance the theme by hooking into WordPress
*
* @package WordPress
* @subpackage Twenty_Nineteen
Expand Down
96 changes: 6 additions & 90 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ function twentynineteen_posted_on() {
esc_html( get_the_modified_date() )
);

echo '<span class="posted-on"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a></span>'; // WPCS: XSS OK.

printf(
'<span class="posted-on">%1$s<a href="%2$s" rel="bookmark">' . $time_string . '</a></span>',
twentynineteen_get_icon_svg( 'watch', 16 ),
esc_url( get_permalink() ),
$time_string
);
}
endif;

Expand Down Expand Up @@ -62,30 +66,6 @@ function twentynineteen_comment_count() {
}
endif;

if ( ! function_exists( 'twentynineteen_estimated_read_time' ) ) :
/**
* Prints HTML with the estimated reading time. Does not display when time to read is zero.
*/
function twentynineteen_estimated_read_time() {
$minutes = twentynineteen_get_estimated_reading_time();
if ( 0 === $minutes ) {
return null;
}
/* translators: TODO comment on placeholders */
$datetime_attr = sprintf( '%dm 0s', $minutes );
/* translators: TODO comment on placeholders */
$read_time_text = sprintf( _nx( '%s Minute', '%s Minutes', $minutes, 'Time to read', 'twentynineteen' ), $minutes );
/* translators: 1: SVG icon. 2: Reading time label, only visible to screen readers. 3: The [datetime] attribute for the <time> tag. 4: Estimated reading time text, in minutes. */
printf(
'<span class="est-reading-time">%1$s<span class="screen-reader-text">%2$s</span><time datetime="%3$s">%4$s</time></span>',
twentynineteen_get_icon_svg( 'watch', 16 ),
__( 'Estimated reading time', 'twentynineteen' ),
$datetime_attr,
$read_time_text
);
}
endif;

if ( ! function_exists( 'twentynineteen_entry_footer' ) ) :
/**
* Prints HTML with meta information for the categories, tags and comments.
Expand Down Expand Up @@ -189,70 +169,6 @@ function twentynineteen_header_featured_image_css() {
}
endif;

if ( ! function_exists( 'twentynineteen_human_time_diff' ) ) :
/**
* Same as core's human_time_diff(), only in the "ago" context,
* which is different for some languages.
*
* @param int $from Unix timestamp from which the difference begins.
* @param int $to Optional Unix timestamp to end the time difference. Defaults to time() if not set.
* @return string Human readable time difference.
*/
function twentynineteen_human_time_diff( $from, $to = '' ) {
if ( empty( $to ) ) {
$to = time();
}

$diff = (int) abs( $to - $from );

if ( $diff < HOUR_IN_SECONDS ) {
$mins = round( $diff / MINUTE_IN_SECONDS );
if ( $mins <= 1 ) {
$mins = 1;
}
/* translators: min=minute */
$since = sprintf( _n( '%s min ago', '%s mins ago', $mins, 'twentynineteen' ), $mins );
} elseif ( $diff < DAY_IN_SECONDS && $diff >= HOUR_IN_SECONDS ) {
$hours = round( $diff / HOUR_IN_SECONDS );
if ( $hours <= 1 ) {
$hours = 1;
}
/* translators: TODO comment on placeholders */
$since = sprintf( _n( '%s hour ago', '%s hours ago', $hours, 'twentynineteen' ), $hours );
} elseif ( $diff < WEEK_IN_SECONDS && $diff >= DAY_IN_SECONDS ) {
$days = round( $diff / DAY_IN_SECONDS );
if ( $days <= 1 ) {
$days = 1;
}
/* translators: TODO comment on placeholders */
$since = sprintf( _n( '%s day ago', '%s days ago', $days, 'twentynineteen' ), $days );
} elseif ( $diff < 30 * DAY_IN_SECONDS && $diff >= WEEK_IN_SECONDS ) {
$weeks = round( $diff / WEEK_IN_SECONDS );
if ( $weeks <= 1 ) {
$weeks = 1;
}
/* translators: TODO comment on placeholders */
$since = sprintf( _n( '%s week ago', '%s weeks ago', $weeks, 'twentynineteen' ), $weeks );
} elseif ( $diff < YEAR_IN_SECONDS && $diff >= 30 * DAY_IN_SECONDS ) {
$months = round( $diff / ( 30 * DAY_IN_SECONDS ) );
if ( $months <= 1 ) {
$months = 1;
}
/* translators: TODO comment on placeholders */
$since = sprintf( _n( '%s month ago', '%s months ago', $months, 'twentynineteen' ), $months );
} elseif ( $diff >= YEAR_IN_SECONDS ) {
$years = round( $diff / YEAR_IN_SECONDS );
if ( $years <= 1 ) {
$years = 1;
}
/* translators: TODO comment on placeholders */
$since = sprintf( _n( '%s year ago', '%s years ago', $years, 'twentynineteen' ), $years );
}

return $since;
}
endif;

if ( ! function_exists( 'twentynineteen_comment_avatar' ) ) :
/**
* Returns the HTML markup to generate a user avatar.
Expand Down
2 changes: 1 addition & 1 deletion inc/ui-icons.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* TODO: File doc comment.
* Custom Icons for this theme
*
* @package WordPress
* @subpackage Twenty_Nineteen
Expand Down
1 change: 0 additions & 1 deletion js/customizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
*/

// TODO: Remove "jshint ignore:line" below once $ is actually used.
( function( $ ) { // jshint ignore:line

} )( jQuery );
4 changes: 4 additions & 0 deletions sass/blocks/_blocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@
margin-bottom: 0.5em;
margin-top: 0.5em;
color: $color__text-main;

em {
font-style: normal;
}
}

cite {
Expand Down
2 changes: 0 additions & 2 deletions sass/elements/_elements.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ hr {
img {
height: auto;
max-width: 100%;
min-height: calc(3 * #{$size__spacing-unit});
position: relative;

&:before {
background-color: $color__background-pre;
border: 1px dashed $color__background-hr;
Expand Down
4 changes: 2 additions & 2 deletions sass/media/_galleries.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

.gallery-item {
display: inline-block;
padding: ( $size__spacing-unit * .5 );
text-align: center;
vertical-align: top;
width: 100%;

// Loops to enumerate the classes for gallery columns.
@for $i from 2 through 9 {
.gallery-columns-#{$i} & {
max-width: map-get( $columns, $i );
max-width: calc( ( 12 / #{$i} ) * (100% / 12) );
}
}
}
Expand All @@ -23,7 +24,6 @@
line-height: $font__line-height-pre;
margin: 0;
padding: ( $size__spacing-unit * .5 );
text-align: left;
}

.gallery-item > div > a {
Expand Down
3 changes: 2 additions & 1 deletion sass/site/header/_site-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@
font-weight: normal;
margin: 0;

.separator {
&:not(:empty):before {
content: "\2014";
margin: 0 .2em;
}
}
25 changes: 25 additions & 0 deletions style-editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,12 @@ body[data-type="core/pullquote"][data-align="right"] .wp-block-pullquote__citati
color: #767676;
}

body[data-type="core/pullquote"] em,
body[data-type="core/pullquote"][data-align="left"] em,
body[data-type="core/pullquote"][data-align="right"] em {
font-style: normal;
}

body[data-type="core/pullquote"][data-align="left"] .editor-block-list__block-edit,
body[data-type="core/pullquote"][data-align="right"] .editor-block-list__block-edit {
max-width: 50%;
Expand Down Expand Up @@ -426,6 +432,25 @@ ul.wp-block-archives li:last-child a:after,
content: ".";
}

/** === Latest Posts grid view === */
.wp-block-latest-posts.is-grid li {
border-top: 2px solid #ccc;
padding-top: 1rem;
margin-bottom: 2rem;
}

.wp-block-latest-posts.is-grid li a:after {
content: '';
}

.wp-block-latest-posts.is-grid li:last-child {
margin-bottom: auto;
}

.wp-block-latest-posts.is-grid li:last-child a:after {
content: '';
}

/** === Latest Comments === */
.wp-block-latest-comments .wp-block-latest-comments__comment-meta {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
Expand Down
4 changes: 4 additions & 0 deletions style-editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ body[data-type="core/pullquote"][data-align="right"] {
text-transform: none;
color: $color__text-light;
}

em {
font-style: normal;
}
}

body[data-type="core/pullquote"][data-align="left"],
Expand Down
Loading

0 comments on commit 924f4df

Please sign in to comment.