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 unit support for image block height and width #55059

Open
richtabor opened this issue Oct 4, 2023 · 4 comments · May be fixed by #62750
Open

Add unit support for image block height and width #55059

richtabor opened this issue Oct 4, 2023 · 4 comments · May be fixed by #62750
Assignees
Labels
[Block] Image Affects the Image Block [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@richtabor
Copy link
Member

In an effort to consolidate aspect ratio across blocks, let's add the unit control functionality that the Featured Image block supports for height and width, to the Image block. Note that aspect ratio should be maintained, regardless of units.

The image block only supports px currently:

CleanShot 2023-10-04 at 14 36 08

As seen in the featured image block:

CleanShot 2023-10-04 at 14 34 20

@richtabor richtabor added [Type] Enhancement A suggestion for improvement. [Block] Image Affects the Image Block labels Oct 4, 2023
@richtabor richtabor added this to Polish Oct 4, 2023
@bgardner
Copy link

bgardner commented Oct 4, 2023

@richtabor For consistency sake, should we mirror the order of Height / Width across the two blocks? Image is Width / Height while Featured Image is Height / Width. (If so, my vote is for the former)

@richtabor
Copy link
Member Author

@richtabor For consistency sake, should we mirror the order of Height / Width across the two blocks? Image is Width / Height while Featured Image is Height / Width. (If so, my vote is for the former)

Certainly. I have this issue to consolidate into a proper component, which would make these 1:1 across the board. #47962

@gsallman
Copy link

gsallman commented Oct 7, 2023

Please, this needs to be implemented as soon as possible since the current implementation is proving to be a backward compatibility nightmare. The previous functionality used %-ages, which scaled responsively. The new implementation does not scale responsively, and if you open an old post to make a minor edit, any images in the post using the old % sizes are updated and given absolute sizes, which do not scale responsively. :(

In short, by using absolute scaling units (px), adding images to a post, adjusting their sizes, and having them responsively scale on various devices is impossible.

@brettsmason
Copy link

I'd love to see this implemented too. Having recently discovered its not possible to extend the list of build-in aspect ratios (unless anyone can could explain how?), this would be the next best thing. Or a way to enter a custom aspect ratio.

@akasunil akasunil linked a pull request Jun 21, 2024 that will close this issue
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

5 participants