Skip to content

Commit

Permalink
Add "Separator" (hr) block to the library.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtias committed May 3, 2017
1 parent f1d30e6 commit 051367e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions blocks/library/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ import './image';
import './text';
import './list';
import './quote';
import './separator';
21 changes: 21 additions & 0 deletions blocks/library/separator/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Internal dependencies
*/
import './style.scss';
import { registerBlock } from 'api';

registerBlock( 'core/separator', {
title: wp.i18n.__( 'Separator' ),

icon: 'minus',

category: 'common',

edit() {
return <hr className="blocks-separator" />;
},

save() {
return <hr />;
}
} );
4 changes: 4 additions & 0 deletions blocks/library/separator/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.blocks-separator {
border: none;
border-bottom: 2px solid $light-gray-800;
}
4 changes: 4 additions & 0 deletions post-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ window._wpGutenbergPost = {
'<p>I imagine prior to the launch of the iPod, or the iPhone, there were teams saying the same thing: the copy + paste guys are <em>so close</em> to being ready and we know Walt Mossberg is going to ding us for this so let\'s just not ship to the manufacturers in China for just a few more weeks… The Apple teams were probably embarrassed. But <strong>if you\'re not embarrassed when you ship your first version you waited too long</strong>.</p>',
'<!-- /wp:core/text -->',

'<!-- wp:core/separator -->',
'<hr />',
'<!-- /wp:core/separator -->',

'<!-- wp:core/image -->',
'<figure><img src="https://cldup.com/Bc9YxmqFnJ.jpg" /></figure>',
'<!-- /wp:core/image -->',
Expand Down

0 comments on commit 051367e

Please sign in to comment.