Repository navigation
Administration: Improve dashboard meta box control visuals - #12339
poligilad-auto wants to merge 2 commits into
Conversation
|
Hi there! 👋 Thank you for your contribution to WordPress! 💖 It looks like this is your first pull request to No one monitors this repository for new pull requests. Pull requests must be attached to a Trac ticket to be considered for inclusion in WordPress Core. To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description. Pull requests are never merged on GitHub. The WordPress codebase continues to be managed through the SVN repository that this GitHub repository mirrors. Please feel free to open pull requests to work on any contribution you are making. More information about how GitHub pull requests can be used to contribute to WordPress can be found in the Core Handbook. Please include automated tests. Including tests in your pull request is one way to help your patch be considered faster. To learn about WordPress' test suites, visit the Automated Testing page in the handbook. If you have not had a chance, please review the Contribute with Code page in the WordPress Core Handbook. The Developer Hub also documents the various coding standards that are followed:
Thank you, |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
55765f5 to
cfb4502
Compare
| .postbox .handlediv:focus { | ||
| box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus, 1.5px) var(--wp-admin-theme-color); | ||
| border-radius: 50%; | ||
| border-radius: 2px; |
There was a problem hiding this comment.
The circular border radius for the focus style is intentional and should not be changed unless there are good functional, usability, and accessibility reasons to change it
There was a problem hiding this comment.
Agreed. The circular focus is also used for other icon buttons in the admin (the Tags box remove buttons, the Widgets screen toggles, and the menu item arrows), so it makes sense to keep it consistent. I removed the focus ring change from this PR entirely, so it keeps the current inset ring from #65060, which fixed the ring getting cut off.
| outline: 2px dashed rgb(0, 0, 0, 0.15); | ||
| outline-offset: -2px; | ||
| box-sizing: border-box; | ||
| border: 1px dashed #c3c4c7; |
There was a problem hiding this comment.
the outline has always been 2 pixels, why this needs to be changed? It needs design feedback anyways.
There was a problem hiding this comment.
This one is intentional. The dashboard widgets use a 1px solid #c3c4c7 border, so a 1px dashed border in the same color makes the empty drop areas match the rest of the dashboard and looks cleaner than the heavier 2px outline. Before and after screenshots are in the PR description. Happy to get more design input if needed.
| border: 1px dashed #c3c4c7; | ||
| border-radius: 8px; | ||
| height: 250px; | ||
| margin: 4px; |
There was a problem hiding this comment.
Please describe why this margin is removed.
There was a problem hiding this comment.
The empty-container class is added to the .meta-box-sortables element itself (see postbox.js), and this rule is more specific, so margin: 4px was overriding that element's regular margin: 0 8px 20px. That made empty drop areas wider than the widgets in the other columns. Removing it lets the empty areas line up with the widgets.
|
|
||
| .is-dragging-metaboxes #dashboard-widgets .postbox-container .empty-container { | ||
| background: rgb(0, 0, 0, 0.01); | ||
| background: rgb(var(--wp-admin-theme-color--rgb), 0.04); |
There was a problem hiding this comment.
rgb colors are not allowed by the CSS Coding Standards. Trunk has already been updated, this needs updating as well.
There was a problem hiding this comment.
Updated to rgba() and rebased on the latest trunk.
cfb4502 to
3e43f2d
Compare
|
Hi @afercia! This PR was closed automatically when 64301 was committed from #12627, since both are linked to 50699. But the visual changes here weren’t part of that commit. Would you be able to take another look? It’s a small CSS follow-up: spacing for the meta box header buttons and a 1px dashed border for the empty dashboard drop areas. Happy to rebase if needed. Thanks! |
| /* one column on the dash */ | ||
| @media only screen and (max-width: 799px) { | ||
| #wpbody-content .metabox-holder .postbox-container .empty-container { | ||
| border: 0; |
There was a problem hiding this comment.
is resetting the border really needed? the empty container on small screens is already height: 0 and box-sizing: border-box;
There was a problem hiding this comment.
Not needed anymore. With the outline back, the existing outline: none covers small screens, so I removed it.
|
|
||
| .rtl .postbox-header .handle-actions { | ||
| padding-right: 0; | ||
| padding-left: 8px; |
There was a problem hiding this comment.
The build process already takes care of RTL and flips the right padding at line 2269 to a left padding.
Manually adding this ruleset will make the Build provess flip it again so that it becomes:
.rtl .postbox-header .handle-actions {
padding-left: 0;
padding-right: 8px;
}
The whole ruleset should be removed.
| outline: 2px dashed rgba(0, 0, 0, 0.15); | ||
| outline-offset: -2px; | ||
| box-sizing: border-box; | ||
| border: 1px dashed #c3c4c7; |
There was a problem hiding this comment.
Thanks, that's a very fair point. Switched back to the 2px outline. I also updated the drag placeholder to the same 2px outline so they match. That rule is shared, so it also applies on other screens that use meta box drag and drop.
|
|
||
| .is-dragging-metaboxes #dashboard-widgets .postbox-container .empty-container { | ||
| background: rgba(0, 0, 0, 0.01); | ||
| background: rgba(var(--wp-admin-theme-color--rgb), 0.04); |
There was a problem hiding this comment.
Good fix, as the other sortables already changed background color but the empty one.
However, the color change is too subtle, I'd consider to make it a little more visible.
There was a problem hiding this comment.
It matches the fill the other columns already get while dragging, so all drop areas look the same. I'd prefer to keep them consistent.
| } | ||
|
|
||
| #dashboard-widgets .meta-box-sortables.empty-container { | ||
| border: 0; |
There was a problem hiding this comment.
same as above, is resetting the border necessary?
Restore the 2px dashed outline for empty dashboard drop areas and use the same outline for the meta box drag placeholder, so both drop areas match. Remove the manual RTL ruleset, since the build flips the padding automatically, and the border resets that are no longer needed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
3e43f2d to
1b515fe
Compare


Trac ticket: https://core.trac.wordpress.org/ticket/50699
Follow-up to: #12180
Summary
Before

`
After


Scope
The postbox header action spacing and the drag placeholder live in
common.css, so they apply to meta boxes generally. The drag highlight is a general meta box drop-zone pattern; this PR only changes the dashboard empty drop area because that is the dashboard-specific part that needed the visual cleanup.Context
This extracts small visual improvements from the broader meta box reordering behavior work so the behavior PR can remain focused on the Screen Options toggle and reordering logic.
Testing
npm exec -- grunt build:csssrc/wp-admin/css/common.cssandsrc/wp-admin/css/dashboard.css