Skip to content

Commit

Permalink
Add the stack block variation to the group block
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Mar 23, 2022
1 parent d2ab852 commit 1d40f79
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 1 addition & 3 deletions packages/block-library/src/group/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@
"fontSize": true
}
},
"__experimentalLayout": {
"allowOrientation": false
}
"__experimentalLayout": true
},
"editorStyle": "wp-block-group-editor",
"style": "wp-block-group"
Expand Down
11 changes: 10 additions & 1 deletion packages/block-library/src/group/variations.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ const variations = [
attributes: { layout: { type: 'flex' } },
scope: [ 'inserter', 'transform' ],
isActive: ( blockAttributes ) =>
blockAttributes.layout?.type === 'flex',
blockAttributes.layout?.type === 'flex' && ( ! blockAttributes.layout?.orientation || blockAttributes.layout?.orientation === 'horizontal' ),
},
{
name: 'group-stack',
title: __( 'Stack' ),
description: __( 'Blocks stacked in a column.' ),
attributes: { layout: { type: 'flex', orientation: 'vertical' } },
scope: [ 'inserter', 'transform' ],
isActive: ( blockAttributes ) =>
blockAttributes.layout?.type === 'flex' && blockAttributes.layout?.orientation === 'vertical',
},
];

Expand Down

0 comments on commit 1d40f79

Please sign in to comment.