Opened 5 months ago
Closed 3 months ago
#63559 closed defect (bug) (fixed)
Buttons on Edit Media screen have smaller height than other buttons
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.9 | Priority: | normal |
| Severity: | normal | Version: | 5.3.1 |
| Component: | Media | Keywords: | has-patch has-screenshots commit |
| Focuses: | ui, css, administration | Cc: |
Description
- On Edit media screen, we have some buttons which are used to update the media, may be crop, rotate etc, for which the buttons sizes are not consistent are less than other buttons across the admin site.
- Button such as, Crop, Scale, rotation have
28pxheight, while the button across site have30px, which looks odd. - When we try to add the crop, we see 2 buttons in line,
Apply CropandClear Crop, which actually identifies this issue, as both buttons are not aligned andClear cropbutton is actually a2pxsmall, which should not be. - CSS which adds this is actually added here, https://github.com/WordPress/wordpress-develop/blob/eeb8fbf81bfc3fe83efd9bc327ac5015211b76b7/src/wp-admin/css/media.css#L974-L980, On changing to
30px, actually resolves the issue.
Attachments (2)
Change History (20)
This ticket was mentioned in PR #8963 on WordPress/wordpress-develop by @hbhalodia.
5 months ago
#1
- Keywords has-patch added
#2
@
5 months ago
- Summary changed from Edit Media: Buttons on edit media screen have samll height which are not consitent with other buttons to Buttons on Edit Media screen have smaller height than other buttons
- Version changed from trunk to 5.3.1
@hbhalodia commented on PR #8963:
5 months ago
#3
Hi @sabernhardt, I have updated the PR to use the 28px line height.
#4
@
5 months ago
- Milestone changed from Awaiting Review to 6.9
- Owner set to joedolson
- Status changed from new to accepted
#5
@
5 months ago
- Keywords has-test-info has-screenshots added
Bug Reproduction and Test Report
✅ This report validates that the indicated patch addresses the issue.
Patch tested: Patch-8963.diff
Environment
- OS: Windows 11 Home
- Web Server: Nginx 1.27.5
- PHP: 8.2.28
- WordPress: 6.9-alpha-60093-src
- Browser: Mozilla Firefox 139.0.1 (Latest)
- Theme: Twenty Fourteen
- Active Plugins:
- Code Snippets 3.6.8
- WordPress Beta Tester 3.6.3
Actual Results
- 🐞 Bug reproduction - On the Media → Edit Image screen, several buttons had inconsistent heights. The "Apply Crop" button was 30px, while other action buttons — "Clear Crop", "Crop", "Scale", and "Rotate" — were only 28px high, resulting in visual misalignment.
Clear crop button 28px
Crop, Scale, Image Rotation - Button 28px
Apply crop button 30px
- ✅ Issue resolved with patch – It standardizes all related buttons to 30px height, resolving the inconsistency.
Apply Crop, Clear Crop button - 30px
Crop, Scale, Image Rotation - Button 30px
Additional Notes
- The above patch works smoothly on smaller screen sizes as well.
#6
@
5 months ago
The solution appears to be working, but it's also affecting other buttons on the same screen. Please ensure that everything remains properly aligned.
#7
@
5 months ago
Hi @mikinc860, Can you please share how it's affecting other buttons, or what other buttons are being affected? It would help in updating the solution.
Thank You,
@mukesh27 commented on PR #8963:
4 months ago
#8
#10
@
4 months ago
- Keywords changes-requested added; commit removed
Added some additional comments on the PR; but to summarize, I don't think this selector is needed anymore, and we can just get rid of all the rules applying to it.
@hbhalodia commented on PR #8963:
4 months ago
#11
I question whether any of the styles in this selector are actually needed. All of them except
width: autoare just duplicating the styles already applied by.wp-core-ui .button; and I don't see that is making any difference.
I think it would be a better change to eliminate this whole selector; I suspect that the only reason it's here is because these _used_ to be icon buttons, and needed different styles to support that.
Yes, I checked that by removing it and seems that it uses .wp-core-ui .button styles, and we can remove that selector. I am updating the PR with the changes.
Thank You,
#12
@
4 months ago
Hi @joedolson, Have updated the PR to eliminate the selector and used default .wp-core-ui button styles for the same.
Thank You,
@sabernhardt commented on PR #8963:
4 months ago
#13
Removing the ruleset makes a big difference on mobile. All the buttons in .imgedit-panel-tools plus 'Clear Crop' would have a larger size and larger text.
Apply Crop would still need the .button class to be consistent with 'Clear Crop' and other buttons.
<button class="button button-primary"
English, before and after, at 750 pixels wide (Edit Media, list view)
French, before and after, at 750 pixels wide (Edit Media, list view)
#14
@
4 months ago
In my opinion, that's a good change on mobile; but would appreciate second opinions on that.
And yes, I agree that this doesn't work unless the Apply Crop button gets .button
@hbhalodia commented on PR #8963:
4 months ago
#15
Apply Crop would still need the
.buttonclass to be consistent with 'Clear Crop' and other buttons.
<button class="button button-primary"
I agree on this, button class should be added on Apply crop button.
For the other changes, I think we should take other opinions as well, but IMO, on mobile button size is same as other buttons on across the admin area. I have checked posts, comments, plugins have same size as we are seeing after change in media.
#16
@
3 months ago
- Keywords commit added; has-test-info changes-requested removed
I gave some thought to exploring the original intent in having these buttons not match the sizing on mobile that other buttons do. Looking at the code history, I think it was just overlooked when the controls were changed from div elements to button elements in 2015; the previous styles were simply copied over to the new button elements without applying global styling for buttons.
As such, in my opinion the larger buttons on mobile is more in keeping with the intentions of the mobile viewport for WordPress and this should be committed with this change.
#17
@
3 months ago
Sorry, that was 2016. But it was in January.... https://github.com/WordPress/wordpress-develop/commit/05934ebd872b6b5169bf0908318f173286dfb227
Button with 28px height