Skip to content

Commit

Permalink
GalleryBlock: remove unused CSS and cleanup front-end.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtias committed Aug 8, 2017
1 parent d7033d5 commit bb010d2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 26 deletions.
5 changes: 0 additions & 5 deletions blocks/library/gallery/block.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
display: flex;
flex-wrap: wrap;

&:not( .components-placeholder ) {
margin-right: -16px;
margin-bottom: -16px;
}

.blocks-gallery-image {
flex-grow: 1;
margin: 0 16px 16px 0;
Expand Down
3 changes: 2 additions & 1 deletion blocks/library/gallery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,10 @@ registerBlockType( 'core/gallery', {

save( { attributes } ) {
const { images, columns = defaultColumnsNumber( attributes ), align = 'none', imageCrop = true, linkTo = 'none' } = attributes;

return (
<div className={ `align${ align } columns-${ columns } ${ imageCrop ? 'is-cropped' : '' }` } >
{ images.map( ( img ) => (
{ images && images.map( ( img ) => (
<GalleryImage key={ img.url } img={ img } linkTo={ linkTo } />
) ) }
</div>
Expand Down
23 changes: 3 additions & 20 deletions blocks/library/gallery/style.scss
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
.wp-block-gallery.is-placeholder {
margin: -15px;
padding: 6em 0;
border: 2px solid $light-gray-500;
text-align: center;
}

.blocks-gallery__placeholder-label {
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;

.dashicon {
margin-right: 1ch;
}
}

.blocks-gallery__placeholder-instructions {
margin: 1.8em 0;
.wp-block-gallery:not( .components-placeholder ) {
margin-right: -16px;
margin-bottom: -16px;
}

.editor-visual-editor__block[data-type="core/gallery"] .editor-visual-editor__block-edit {
Expand Down

0 comments on commit bb010d2

Please sign in to comment.