Repository navigation
Description
Description
Cc: @mirka, Was just checking the PR mentioned and found that no followup was created, thought to create the issue.
Follow-up to #85812, as suggested in this review comment.
The icons in the shape of each ratio in the Aspect ratio dropdown have soft, blurry outlines, while the Original icon in the same list is sharp. This shows wherever the dropdown appears: Image, Cover, Featured Image, Site Logo and the Styles panel.
AspectRatioIcon works out the rectangle's position and size from the ratio (aspect-ratio-icon.tsx L31-L32, L46-L52) and draws a 1.5px line centred on those edges. The edges land on whole numbers, halves or thirds, so the line covers only part of the pixels at both of its sides, and the browser smooths it into a wider grey outline. The generic icon puts its edges at .25 and .75, so its line covers whole pixels on a 2x display:
| Icon | Edge | Line covers |
|---|---|---|
| Original (generic icon) | 4.25 | 3.5 to 5.0 |
| Square, 4:3, 3:2, 16:9 (left) | 4 | 3.25 to 4.75 |
| 16:9 (top) | 7.5 | 6.75 to 8.25 |
| 2:3 (left) | 6.667 | 5.917 to 7.417 |
Snapping each computed edge to the nearest .25 or .75 would make the shapes as sharp as the generic icon. For 4:3, it gives exactly the generic icon's frame.
Expected: the ratio icons are as sharp as the Original icon.
Actual: every ratio icon, including Square and 4:3, has a soft outline.
Step-by-step reproduction instructions
This is easiest to see on a 2x (Retina) display.
- Insert an Image block, add an image, and keep the block selected.
- In the block settings sidebar, open the Aspect ratio dropdown.
- Compare Original with Standard - 4:3, which has nearly the same shape. Zoom into a screenshot of the two icons.
- Choose Wide - 16:9 and zoom into the icon in the closed dropdown.
The AspectRatioTool stories WithOptions and CustomRatio in Storybook show the same thing.
Screenshots, screen recording, code snippet
Environment info
- WordPress Latest
- Gutenberg Trunk
AI Usage
- Drafted the issue with help of ClaudeCode Opus 5.5
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Please confirm which theme type you used for testing.
- Block
- Classic
- Hybrid (e.g. classic with theme.json)
- Not sure
Activity