Skip to content

Commit

Permalink
Added a vertical style to the Buttons block
Browse files Browse the repository at this point in the history
  • Loading branch information
nfmohit-wpmudev committed Feb 11, 2020
1 parent b3f900c commit 7188561
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
12 changes: 9 additions & 3 deletions packages/block-library/src/buttons/editor.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
.wp-block-buttons .wp-block.block-editor-block-list__block[data-type="core/button"] {
display: inline-block;
width: auto;
.wp-block-buttons {
.wp-block.block-editor-block-list__block[data-type="core/button"] {
display: inline-block;
width: auto;
}

&.is-style-vertical .wp-block.block-editor-block-list__block[data-type="core/button"] {
display: block;
}
}

.wp-block-buttons {
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/buttons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export const settings = {
align: true,
alignWide: false,
},
styles: [
{ name: 'horizontal', label: __( 'Horizontal' ), isDefault: true },
{ name: 'vertical', label: __( 'Vertical' ) },
],
transforms,
edit,
save,
Expand Down
20 changes: 14 additions & 6 deletions packages/block-library/src/buttons/style.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
.wp-block-buttons .wp-block-button {
display: inline-block;
margin: $grid-size-small;
}
.wp-block-buttons.aligncenter {
text-align: center;
.wp-block-buttons {

&.aligncenter {
text-align: center;
}

.wp-block-button {
display: inline-block;
margin: $grid-size-small;
}

&.is-style-vertical .wp-block-button {
display: block;
}
}

0 comments on commit 7188561

Please sign in to comment.