Skip to content

Commit

Permalink
Fix block padding + wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jun 29, 2017
1 parent 032af2d commit e37894c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
28 changes: 12 additions & 16 deletions blocks/library/latest-posts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,18 @@ registerBlockType( 'core/latestposts', {
/>
</InspectorControls>
),
<div className={ this.props.className } key="latest-posts">
<ul className="blocks-latest-posts__list">
{ latestPosts.map( ( post, i ) =>
<li key={ i }>
<a href={ post.link }>{ post.title.rendered }</a>
{ displayPostDate && post.date_gmt &&
(
<span className="blocks-latest-posts__post-date">
{ moment( post.date_gmt ).local().format( 'MMM DD h:mm A' ) }
</span>
)
}
</li>
) }
</ul>
</div>,
<ul className={ this.props.className } key="latest-posts">
{ latestPosts.map( ( post, i ) =>
<li key={ i }>
<a href={ post.link }>{ post.title.rendered }</a>
{ displayPostDate && post.date_gmt &&
<span className={ `${ this.props.className }__post-date` }>
{ moment( post.date_gmt ).local().format( 'MMM DD h:mm A' ) }
</span>
}
</li>
) }
</ul>,
];
}

Expand Down
6 changes: 3 additions & 3 deletions blocks/library/latest-posts/style.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.blocks-latest-posts .blocks-latest-posts__list {
padding-left: 1em;
div[data-type="core/latestposts"] .wp-block-latestposts {
padding-left: 2.5em;
}

.blocks-latest-posts__post-date {
.wp-block-latestposts__post-date {
display: block;
color: $dark-gray-100;
font-size: $default-font-size;
Expand Down

0 comments on commit e37894c

Please sign in to comment.