Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase the viewport width (non-scaled) for template previews #21287

Merged
merged 1 commit into from
Mar 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function BlockPattern( { pattern, onClick } ) {
tabIndex={ 0 }
>
<div className="block-editor-patterns__item-preview">
<BlockPreview blocks={ blocks } />
<BlockPreview blocks={ blocks } viewportWidth={ 800 } />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept a smaller width here because most themes have a centered area around that size.

</div>
<div className="block-editor-patterns__item-title">{ title }</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function TemplatePartPreview() {
<div className="wp-block-template-part__placeholder-preview-title">
{ __( 'Preview' ) }
</div>
<BlockPreview blocks={ blocks } />
<BlockPreview blocks={ blocks } viewportWidth={ 1200 } />
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ function TemplatePreview( { item } ) {
);
return (
<div className="edit-site-template-switcher__preview">
{ !! blocks && <BlockPreview blocks={ blocks } /> }
{ !! blocks && (
<BlockPreview blocks={ blocks } viewportWidth={ 1200 } />
) }
</div>
);
}
Expand Down