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 Mar 16, 2020
1 parent e8b5c2e commit e45ebb6
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-unit-05;
}
.wp-block-buttons.aligncenter {
text-align: center;
.wp-block-buttons {

&.aligncenter {
text-align: center;
}

.wp-block-button {
display: inline-block;
margin: $grid-unit-05;
}

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

0 comments on commit e45ebb6

Please sign in to comment.