Dashboard: scale widget picker previews to fill their card#78602
Conversation
render at 0.8 scale with a 125% box so it fills 100% of the area
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the dashboard widget picker’s live preview wrapper so previews render “zoomed out” and visually fill the square media slot, instead of appearing clipped in the top-left.
Changes:
- Update the widget picker preview wrapper to use a 125% box scaled down via
transform: scale(0.8)withtransform-origin: top left. - Remove preview padding so the scaled preview can fill the card area edge-to-edge.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| width: 125%; | ||
| height: 125%; | ||
| overflow: hidden; | ||
| padding: var(--wpds-dimension-padding-md); | ||
| padding: 0; | ||
| transform: scale(0.8); |
|
Size Change: 0 B Total Size: 8.04 MB ℹ️ View Unchanged
|

What?
Scales the live widget previews in the dashboard widget picker (the "Add widget" inserter grid) so each preview fills its card instead of rendering cramped in the top-left corner.
The preview content now renders at
0.8scale inside a125%box, so the scaled result occupies 100% of the slot area.Why?
Each widget type is shown in the picker as a live preview inside a square media slot. Widgets are designed as full-size dashboard tiles, so at thumbnail scale they were clipped to their top-left corner, leaving the preview hard to read and visually unbalanced.
Rendering the widget slightly zoomed out lets more of it show within the same card, so the preview reads as a representation of the whole widget rather than a cropped fragment.
How?
The change is confined to the picker's own
.previewwrapper. It is sized to125%of the slot in both dimensions and scaled down withtransform: scale(0.8)anchored at the top-left. Since125% × 0.8 = 100%, the scaled content fills the slot exactly, with no empty margins.No DataViews internals are touched: only the class we render ourselves is styled.
Testing
Follow-ups