Navigation Menu

Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
Add post classes where appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymcp committed Dec 7, 2018
1 parent 027ad8a commit 81928c6
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion assets/styles/app.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion partials/post/post-full.php
Expand Up @@ -3,7 +3,7 @@

$caption = Benenson_Display_Image_Credit::description( get_post_thumbnail_id( get_the_ID() ) );
?>
<article class="post postImage--full" role="article" aria-label="Article: <?php echo esc_attr( format_for_aria_label( get_the_title() ) ); ?>" style="background-image: url(<?php echo esc_attr( esc_url( $featured_image ) ); ?>)">
<article id="post-<?php the_ID(); ?>" <?php post_class( [ 'postImage--full' ] ); ?> role="article" aria-label="Article: <?php echo esc_attr( format_for_aria_label( get_the_title() ) ); ?>" style="background-image: url(<?php echo esc_attr( esc_url( $featured_image ) ); ?>)">
<?php get_template_part( 'partials/post/post', 'content' ); ?>
<?php if ( $caption ) : ?>
<span class="image-caption" aria-hidden="true"><?php echo esc_html( $caption ); ?></span>
Expand Down
2 changes: 1 addition & 1 deletion partials/post/post-horizontal.php
Expand Up @@ -7,7 +7,7 @@
}

?>
<article class="post post--horizontal postImage--small" role="article" aria-label="Article: <?php echo esc_attr( format_for_aria_label( get_the_title() ) ); ?>">
<article id="post-<?php the_ID(); ?>" <?php post_class( [ 'post--horizontal', 'postImage--small' ] ); ?> role="article" aria-label="Article: <?php echo esc_attr( format_for_aria_label( get_the_title() ) ); ?>">
<figure class="post-figure">
<div class="post-figure-ratio" style="background-image: url( <?php echo esc_url( $featured_image ); ?> )">
<img src="<?php echo esc_url( $featured_image ); ?>" alt="">
Expand Down
2 changes: 1 addition & 1 deletion partials/post/post-none.php
@@ -1,3 +1,3 @@
<article class="post postImage--none" role="article" aria-label="Article: <?php echo esc_attr( format_for_aria_label( get_the_title() ) ); ?>">
<article id="post-<?php the_ID(); ?>" <?php post_class( [ 'postImage--none' ] ); ?> role="article" aria-label="Article: <?php echo esc_attr( format_for_aria_label( get_the_title() ) ); ?>">
<?php get_template_part( 'partials/post/post', 'content' ); ?>
</article>
2 changes: 1 addition & 1 deletion partials/post/post-search.php
Expand Up @@ -11,7 +11,7 @@
$date = benenson_locale_date( $epoch );

?>
<article class="post post--result" role="article" aria-label="Article: <?php echo esc_attr( format_for_aria_label( get_the_title() ) ); ?>">
<article id="post-<?php the_ID(); ?>" <?php post_class( [ 'post--result' ] ); ?> role="article" aria-label="Article: <?php echo esc_attr( format_for_aria_label( get_the_title() ) ); ?>">
<a class="floating-anchor" href="<?php the_permalink(); ?>" aria-hidden="true"></a>
<?php if ( $post_term ) : ?>
<?php $post_term_link = get_term_link( $post_term, $post_term->taxonomy ); ?>
Expand Down
2 changes: 1 addition & 1 deletion partials/post/post-small.php
Expand Up @@ -3,7 +3,7 @@
$featured_image_2x = benenson_featured_image( get_the_ID(), 'post-half@2x' );

?>
<article class="post postImage--small" role="article" aria-label="Article: <?php echo esc_attr( format_for_aria_label( get_the_title() ) ); ?>">
<article id="post-<?php the_ID(); ?>" <?php post_class( [ 'postImage--small' ] ); ?> role="article" aria-label="Article: <?php echo esc_attr( format_for_aria_label( get_the_title() ) ); ?>">
<figure class="post-figure">
<div class="post-figure-ratio" style="background-image: url( <?php echo esc_url( $featured_image ); ?> )">
<img src="<?php echo esc_url( $featured_image ); ?>" alt="">
Expand Down
2 changes: 1 addition & 1 deletion single.php
Expand Up @@ -67,7 +67,7 @@
<h1 id="article-title" class="article-title"><?php the_title(); ?></h1>
</header>

<article class="article-content <?php $reduced_width && print 'is-narrow'; ?>" role="article" aria-labelledby="article-title">
<article id="post-<?php the_ID(); ?>" <?php post_class( [ 'article-content', $reduced_width ? 'is-narrow' : '' ] ); ?> role="article" aria-labelledby="article-title">
<?php if ( $recipients ) : ?>
<details class="article-recipients">
<summary><?php esc_html_e( 'View Recipients', 'benenson' ); ?></summary>
Expand Down
21 changes: 10 additions & 11 deletions src/styles/pages/_article.scss
Expand Up @@ -138,6 +138,16 @@
max-width: 100%;
order: 1;

.post {
border: none;

&:hover,
&:active,
&:focus {
box-shadow: none;
}
}

@include mq(medium-sm) {
flex: 1 1 calc(100% - 88px);
order: 2;
Expand Down Expand Up @@ -332,7 +342,6 @@
align-items: center;
width: 50px;
height: 50px;
//background-color: $color-black;
border-radius: 50%;
border: 1px solid $color-grey-x-light;
}
Expand All @@ -342,17 +351,7 @@
}

.article-share ul li + li {
//border-left: 1px solid $color-grey-light;

.rtl & {
//border-right: 1px solid $color-grey-light;
//border-left: none;
}

@include mq(small) {
//border-top: 1px solid $color-grey-light;
//border-left: none;

.rtl & {
border-right: none;
}
Expand Down

0 comments on commit 81928c6

Please sign in to comment.