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

Add aspect ratio support to Post Featured Image block #47274

Closed
richtabor opened this issue Jan 19, 2023 · 2 comments
Closed

Add aspect ratio support to Post Featured Image block #47274

richtabor opened this issue Jan 19, 2023 · 2 comments
Labels
[Block] Post Featured Image Affects the Post Featured Image Block Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.

Comments

@richtabor
Copy link
Member

What problem does this address?

Related to #38990, but it's easier to implement this as a first-pass on the Post Featured Image block. The Image block is more difficult, as we have to account for cropping via the Image block's existing crop aspect ratio tool.

What is your proposed solution?

Let's add support for the upcoming aspect ratio theme.json presets (#47271) to the Post Featured Image block.

post-featured-image

I put the width and height controls below the aspect ratio, as the aspect ratio affects the height (which is calculated based on the aspect ratio and width). I also have them inverted for consistency with the current image size controls in the Image block; in today's Post Featured Image block, height is first.

@richtabor richtabor added Needs Design Feedback Needs general design feedback. [Block] Post Featured Image Affects the Post Featured Image Block labels Jan 19, 2023
@Thelmachido Thelmachido added the [Type] Enhancement A suggestion for improvement. label Jan 24, 2023
@Thelmachido
Copy link

I would agree that this option would make the visual presentation of content better.

At the moment, the Post Featured Image block when added to a template will render width as per block settings e.g Wide width, Full width, etc which is great. However, the rendered height of the image depends on the size of the image.

This affects the display of content because post-featured images are being displayed at different heights. This seems to be a bit buggy, the expected behavior would be for all posts to display the same height regardless of the image size folks upload.

I provided the CSS below for the site to display a fixed height.

.wp-block-post-featured-image img {
    height: 500px;
    object-fit: cover;   
}

+1 this issue because of this forum thread folks wanting to know how to crop the featured image.

@richtabor richtabor changed the title Add aspect ratio support to Post Featured Image Block dimensions Add aspect ratio support to Post Featured Image block Feb 14, 2023
@richtabor
Copy link
Member Author

I'm cool with closing this, as #47854 added the initial functionality, with follow ups outlined in #47963

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Featured Image Affects the Post Featured Image Block Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants