Skip to content

Commit

Permalink
Use example viewport width in style previews
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jul 11, 2021
1 parent d775b34 commit 210a123
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/block-editor/src/components/block-styles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ function BlockStyles( {
return (
<BlockStyleItem
genericPreviewBlock={ genericPreviewBlock }
viewportWidth={ type.example?.viewportWidth ?? 500 }
className={ className }
isActive={ activeStyle === style }
key={ style.name }
Expand All @@ -127,6 +128,7 @@ function BlockStyles( {

function BlockStyleItem( {
genericPreviewBlock,
viewportWidth,
style,
isActive,
onBlur,
Expand Down Expand Up @@ -165,7 +167,10 @@ function BlockStyleItem( {
aria-label={ style.label || style.name }
>
<div className="block-editor-block-styles__item-preview">
<BlockPreview viewportWidth={ 500 } blocks={ previewBlocks } />
<BlockPreview
viewportWidth={ viewportWidth }
blocks={ previewBlocks }
/>
</div>
<div className="block-editor-block-styles__item-label">
{ style.label || style.name }
Expand Down

0 comments on commit 210a123

Please sign in to comment.