From 1a26e04d518366620095039f6bd41a38122c26c7 Mon Sep 17 00:00:00 2001 From: Khokan Sardar Date: Thu, 23 Jul 2026 20:32:40 +0530 Subject: [PATCH] Media: Match the list view filter bar spacing to the grid view. Since [61757] the Media Library grid view toolbar has been sized by `padding: 12px 16px` rather than a fixed height, while the list view filter bar kept the generic `.wp-filter` padding of `0 10px`. This left the top bar spacing visibly inconsistent between the two modes. Apply the same padding to the filter bar on the Media Library screen so both modes line up. The grid view toolbar is excluded via `:not(.media-toolbar)`. On upload.php `wp_enqueue_media()` runs before admin-header.php enqueues `colors`, so media-views.css is printed before media.css. An unscoped `.upload-php .wp-filter` rule has equal specificity and would therefore override `.attachments-browser .media-toolbar`, silently becoming the source of the grid toolbar's padding. Excluding it keeps that rule authoritative and leaves the grid view untouched. Fixes #65697. --- src/wp-admin/css/media.css | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/wp-admin/css/media.css b/src/wp-admin/css/media.css index dbce2c705995c..d1248f293a93a 100644 --- a/src/wp-admin/css/media.css +++ b/src/wp-admin/css/media.css @@ -451,6 +451,16 @@ border color while dragging a file over the uploader drop area */ margin: 0 6px 0 0; } +/* Match the spacing the grid view toolbar gets from + `.attachments-browser .media-toolbar` in media-views.css, so the Media + Library filter bar is consistent in both modes. The grid view toolbar is + excluded so that rule stays the single source of its own padding: media.css + is printed after media-views.css here, so an unscoped rule would override + it. */ +.upload-php .wp-filter:not(.media-toolbar) { + padding: 12px 16px; +} + /** * Media Library grid view */