Skip to content

Commit

Permalink
feat: add image shape classes to the front end (#473)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurelfulford authored May 12, 2020
1 parent 91ecd2c commit c90df2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/blocks/homepage-articles/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ class Edit extends Component {
[ `image-align${ mediaPosition }` ]: showImage,
[ `is-${ imageScale }` ]: imageScale !== '1' && showImage,
'mobile-stack': mobileStack,
[ `image-shape${ imageShape }` ]: imageShape !== 'landscape',
[ `is-${ imageShape }` ]: showImage,
'has-text-color': textColor.color !== '',
'show-caption': showCaption,
'show-category': showCategory,
Expand Down
3 changes: 3 additions & 0 deletions src/blocks/homepage-articles/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ function newspack_blocks_render_block_homepage_articles( $attributes ) {
if ( $attributes['showImage'] && isset( $attributes['imageScale'] ) ) {
$classes .= ' is-' . $attributes['imageScale'];
}
if ( $attributes['showImage'] ) {
$classes .= ' is-' . $attributes['imageShape'];
}
if ( $attributes['showImage'] && $attributes['mobileStack'] ) {
$classes .= ' mobile-stack';
}
Expand Down

0 comments on commit c90df2e

Please sign in to comment.