-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Featured Image block: Allow free-form resizing #27620
Comments
This is related: #24660. There are design explorations as well. |
To make sure feedback isn't lost from this recent WP Tavern post, I'm sharing here as it's relevant to the discussion above:
This was identified as a current pain point in the FSE experience. |
I took the liberty of tweaking the title and content of this ticket a little bit, with some mockup work from the now-closed #31418. |
I would add another Setting with a slider where you can adjust the ratio. |
The controls suggested by @kjellr Kjell seems like a good first iteration/version. I do have one question. Will the "contain" option in a way crop very tall images? So that all images look nice at the height and width suggested? We do also have the possibility to use the Focal point picker having a more finetuned selection as @leph83 touches upon. For a more advanced version we have @shaunandrews Shaun's mockups here: #24660 (comment) |
@paaljoachim I'm not a huge fan of fixed pixel sizes. It's not responsive. |
The blue px indicator is meant to be a unit selection dropdown, so you could choose other units, such as %, vw, vh, em, rem, etc. |
So if I have 3 Columns with a picture inside of each, that I wanted to make square I could set the properties to 100% height and 100% Width to achieve that? That would work for me. I don't see the possibility to choose the object position in your design, when I chose cover as my scaling option. That would be nice to have. |
Well, if those 3 columns were part of a query, then setting the dimensions of one of the featured images to square would do it for all of them, yes. I'd agree it would be nice to also have the focal point picker for the featured image block, but I'd think it would be a nice followup to do. Also keep in mind that themes could do it in the manually as well. |
Oh I missed the part, where it's a query. This feature would also be amazing for the Gallery Block and the Image Block itself too |
In order to use --edit: Maybe having only a Any thoughts? |
Could the featured image be a variant of the image block, just with a different source? |
I recently made some exploration for making it a block variation of I believe landing at least a basic handling for now like the above would be okay for now and gives value, in order to make it to 5.8. I'll have a PR soon for this and we can test how it feels. |
I wanted to add some clarification to this since it was added to a ticket about Dimensions. While related, I was specifically referring to the Image Size control (e.g., full, thumbnail, medium, large, custom-theme-size, etc.) and not width/height controls. These are the sizes created via This ticket seems to be moving toward a path for dimension and scaling controls, which is great, but I don't want this feature to get lost if it's out of scope for this ticket. I can open a separate ticket if needed. |
Just to weight in here to provide some end user perspective. Rolling out a new block which is aimed at replacing blocks like 'Latest Posts' before reaching feature parity is a major pain in the ass as you keep having to relearn stuff, hit brick walls and end up at GitHub, which lets be honest, isn't somewhere your average Joe is going to want to start digging around to find out why they can't change the image size in a significant new feature. By way of example there are now two blocks to create a grid of posts and one handles featured images better than the other provided it's a post I want to use and not a CPT or Page, if that's the case then I'll have to hard crop them all. This is incredibly frustrating, a waste of time, confusing and tough to explain to an end user. I just find it a lot of wasted effort to have all this discussion around a completely different implementation when the featured image control works perfectly well in the 'Latest Posts' block and is familiar to a user since it's basically the same as an image block. Having to relearn an approach with a replacement block and discover limitations, inconsistencies of feature sets to what on the surface appear the same components and lack of feature parity for existing approaches with replacement blocks is a consistent blight on the Gutenberg project. |
Should this ticket be closed by #31634? I was under the impression that an Image Size control was a part of this, which is why I didn't open another ticket (it would also partially cover @antonyjsmith's concerns). I don't think this is in the PR. |
The issue was closed automatically from the PR and addressed the initial proposed enhancements. There are more to come to this block (Featured Image) and we have this issue for consolidating the 'posts list' blocks. I created a new issue for the image controls here: #33789 |
What problem does this address?
When working with in the Query block's grid view, it would be great to allow for themes to set a consistent height/crop for all of the Featured images within.
Example use case, where each image is cropped to a square:
The current lack of dimension controls on the featured image block means individual image aspect ratios are unchanged, causing a bit of a jumpy layout:
What is your proposed solution?
If we enable dimension controls and allow object-fit properties to be configured (defaulting to
cover
), we can enable some much more coherent and nice layouts. Shown here with some custom border radii applied as well:Here's what the featured image inspector controls could look like:
This was previously explored in #27545
The text was updated successfully, but these errors were encountered: