-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
[Block] ImageAffects the Image BlockAffects the Image Block[Type] EnhancementA suggestion for improvement.A suggestion for improvement.
Description
Based on the design explorations in #38990, let's implement the aspect ratio control for the core/image
block.
Visual
Objective
If I have an aspect ratio applied to an Image block with a set height and width, I should be able to drop in another image and the aspect ratio, height, and width values are all maintained.
Tasks
- Add "Aspect Ratio" SelectControl below "Resolution" to core/image block.
- Set default value of the aspect ratio control to "Original".
- Update edit/save.
- If block has aspect ratio and intrinsic height/width, set both inputs to "Auto"
- If block has aspect ratio value, render Contain/Cover ToggleGroup.
- If one input is changed, calculate the other (maintaining "Auto" visually).
- If both inputs are changed, set aspect ratio select to "Custom" and use the non-intrinsic height/width values as the aspect-ratio css.
Follow-up
- Add support for height, width, and aspect ratio controls for Image blocks without media (placeholder).
ajlende, draganescu, annezazu, priethor, porg and 3 more
Metadata
Metadata
Labels
[Block] ImageAffects the Image BlockAffects the Image Block[Type] EnhancementA suggestion for improvement.A suggestion for improvement.