Skip to content

Site Logo: The placeholder stretches if the size is a non-default value  #45788

Closed

Description

Description

The stretched placeholder is unpleasant, and it should scale to the size specified in the markup.

Context:
Let's say there is a header pattern with a site logo that is 100x100 px. When this pattern is added to a site that has no site logo, the placeholder stretches like the below.

Screenshot 2022-11-15 at 23 03 04

If the size of the site logo is the default size (120x120px), the placeholder will look as expected. However, it's reasonable for a theme to specify a custom size of the logo, and the placeholder should scale to whatever the size of the logo is intended.

Screenshot 2022-11-15 at 23 20 41

Step-by-step reproduction instructions

  1. Make a pattern with a site logo. (Or use the markup below)
  2. Add an image to the block and change the size to whatever but not-default. (Or use the markup below)
  3. Copy the markup and paste it to another site that has no site logo.
  4. See the size of the placeholder.

Screenshots, screen recording, code snippet

A sample markup. Copy and paste it to a site without a logo.

<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"2em","bottom":"2em"},"blockGap":"16px"}}} -->
<div class="wp-block-group alignfull" style="padding-top:2em;padding-bottom:2em"><!-- wp:site-logo {"width":100,"shouldSyncIcon":true,"align":"center"} /-->

<!-- wp:site-title {"textAlign":"center","style":{"typography":{"textTransform":"uppercase"}},"fontSize":"medium"} /-->

<!-- wp:navigation {"ref":458,"layout":{"type":"flex","justifyContent":"center"}} /--></div>
<!-- /wp:group -->

Environment info

  • WP 6.1
  • Gutenberg trunk (the same happens without Gutenberg plugin.)

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Needs TestingNeeds further testing to be confirmed.[Block] PatternAffects the Patterns Block[Block] Site LogoAffects the Site Logo Block

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions