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

A consistent aspect ratio component #47962

Open
scruffian opened this issue Feb 10, 2023 · 5 comments
Open

A consistent aspect ratio component #47962

scruffian opened this issue Feb 10, 2023 · 5 comments
Labels
[Block] Post Featured Image Affects the Post Featured Image Block [Type] Code Quality Issues or PRs that relate to code quality [Type] Enhancement A suggestion for improvement.

Comments

@scruffian
Copy link
Contributor

scruffian commented Feb 10, 2023

What problem does this address?

We have two copies of the image aspect ratios (one in Global Styles (and the Image block), and the other in the Featured Image block #47854).

What is your proposed solution?

We should find a way to share this code, potentially moving the width/height/scale/aspect ratios to components. These experiences should be consistent across the board, as well as future implementations (like the Cover block #54032).

This is blocked by #55059, which allows for the Image block to utilize units for image sizes. When that's complete, these controls can be 1:1 across both (and future) areas.

Other ideas

  1. The default aspect ratios could be an editor setting (provided by Add aspect ratio presets support via theme.json #47271), that could be open to be overridden via global styles
@ajlende
Copy link
Contributor

ajlende commented Feb 10, 2023

In #47271 the settings are saved in theme.json

@cbirdsong
Copy link

This would also be addressed by eliminating one-off blocks like this. See:

@richtabor
Copy link
Member

@scruffian The idea here is that the aspect ratios will be part of Global Styles and referenced throughout related controls. This PR (#47271) was the start of that, but we held off for 6.2.

Is this what you're referring to?

@scruffian
Copy link
Contributor Author

At the moment we have some settings in Global Styles and some in the Post Featured Image block. They are the same, but they are separate lists - so if we change one there's a risk we forget to change the other and they'll become out of sync. We should update this so that there is only one list to remove that risk.

@kathrynwp kathrynwp added the [Type] Enhancement A suggestion for improvement. label Mar 27, 2023
@richtabor richtabor changed the title Image Aspect Ratio: Share the settings A consistent aspect ratio experience Oct 4, 2023
@richtabor richtabor changed the title A consistent aspect ratio experience A consistent aspect ratio component Oct 4, 2023
@jasmussen
Copy link
Contributor

Following up on this one, now that the Cover block has an aspect ratio control, it'd be good to bring that to Featured Image and Image as well, since it's the correct 40px size.

See also #58230

@mtias mtias added the [Type] Code Quality Issues or PRs that relate to code quality label Sep 29, 2024
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 [Type] Code Quality Issues or PRs that relate to code quality [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

7 participants