Skip to content

CSS: Add padding to labels in media filter container - #11927

Closed
Infinite-Null wants to merge 13 commits into
WordPress:trunkfrom
Infinite-Null:fix/media-modal-filter-label-spacing
Closed

Infinite-Null wants to merge 13 commits into
WordPress:trunkfrom
Infinite-Null:fix/media-modal-filter-label-spacing

Conversation

@Infinite-Null

@Infinite-Null Infinite-Null commented May 21, 2026 •

Copy link
Copy Markdown

https://core.trac.wordpress.org/ticket/65300

What

Added a 6px top margin to align with the media modal and maintain visual consistency.

Screenshot 2026-05-22 at 10 26 10 PM Screenshot 2026-05-22 at 10 26 46 PM

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The 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

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@Infinite-Null
Infinite-Null marked this pull request as ready for review May 22, 2026 17:00
@github-actions

github-actions Bot commented May 22, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props ankitkumarshah, wildworks, jorbin, masteradhoc.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@t-hamano

t-hamano commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR. However, the attached screenshot does not match my local trunk branch.

First, the media library itself lacks visual labels in the first place:

Screenshot 0008-06-07 at 20 48 10

Furthermore, the .media-frame.mode-grid .media-toolbar selector should not apply to the media library launched in the block editor.

Could you test again if this PR is correct?

@masteradhoc

Copy link
Copy Markdown

@Infinite-Null Thank you very much for the PR. i can confirm the findings of @t-hamano.

The media library looks fine without this PR:
image

With this PR it looks misaligned:
image

--

As we'll the author reported the labels to be too close together - specifically at the select or upload media screen (right @deeppatel8950?)
image

This hasnt been fixed yet. Can you take a look at this?
If you dont have time currently no worries! Feel free to close this PR.

@Infinite-Null

Copy link
Copy Markdown
Author

Thanks for checking this!

There might have been an environment-specific issue when I initially tested this. In fact, I attached a screenshot in the PR itself of what I was seeing.

Based on the feedback, I've updated the PR to target only the media modal used for selecting media in the block editor.

Could you please test the latest changes and let me know if they now match the expected behavior?

Screenshot 2026-06-28 at 8 01 19 PM

@masteradhoc

Copy link
Copy Markdown

Thanks for the update @Infinite-Null, this looks good on my side as well:
image

Maybe we could add some more spacing as well for smaller screens between the fields? (565px width on my test)
image

@Infinite-Null

Copy link
Copy Markdown
Author

Done! I've added some extra spacing (that is 8px) between the fields for smaller screens as well. Could you please take another look and let me know if it looks good now?

@t-hamano t-hamano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

The height of the fields within the media toolbar has increased, so we might need to increase the height of the media toolbar itself. Although there's no visual overflow, using browser developer tools reveals that the elements are conflicting with the container's padding.

Image

cc @joedolson @sabernhardt believe you were knowledgeable in this area.

Comment on lines +3017 to +3023
@media only screen and (max-width: 565px) {
label[for="media-attachment-filters"],
label[for="media-attachment-date-filters"],
label[for="media-search-input"] {
margin-bottom: 8px;
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added some extra spacing (that is 8px) between the fields for smaller screens as well.

This CSS increases the space between field labels and fields in the mobile layout. However, it's possible that @masteradhoc intended to increase the space between the fields themselves.

Image

That said, the spacing between fields is a separate issue, so we probably don't need to consider it in this PR.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@t-hamano thanks yeah, that was my intention as it seemed too close :)

@t-hamano

t-hamano commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

@Infinite-Null, sorry for the late reply. Could you resolve the conflicts and take another look so that we can make a final decision on whether to merge this PR?

@Infinite-Null

Copy link
Copy Markdown
Author

Thank you very much for the feedback, and sorry for the delayed response! I’ve updated the PR to address the height concern and resolved the merge conflict. Could you please take another look when you have a chance?

Screenshot 2026-11-17 at 5 06 21 PM Screenshot 2026-11-17 at 5 10 41 PM

cc: @t-hamano @masteradhoc

@Infinite-Null
Infinite-Null force-pushed the fix/media-modal-filter-label-spacing branch from 49ecfb3 to 7548466 Compare November 17, 2026 11:45
Comment thread src/wp-includes/css/media-views.css Resolved
Comment thread src/wp-includes/css/media-views.css Resolved
@Infinite-Null

Copy link
Copy Markdown
Author

Thank you for the feedback @t-hamano! I’ve updated the PR accordingly. Could you please take another look. Thank you.

@t-hamano t-hamano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I added just one last suggestion, but everything looks good. I plan to release this change in 7.3, so I will commit it to trunk once the 7.2 branch is created.

Comment on lines +3035 to +3041
@media only screen and (max-width: 565px) {
.media-modal label[for="media-attachment-filters"],
.media-modal label[for="media-attachment-date-filters"],
.media-modal label[for="media-search-input"] {
margin-bottom: 8px;
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the media queries in this file are ordered from the widest to the narrowest (900px → 782px → 640px → 480px). Could we move this max-width: 565px block above the existing max-width: 480px block to keep that order?

@media only screen and (max-width: 565px) {
	.media-modal label[for="media-attachment-filters"],
	.media-modal label[for="media-attachment-date-filters"],
	.media-modal label[for="media-search-input"] {
		margin-bottom: 8px;
	}
}

@media only screen and (max-width: 480px) {
	.wp-core-ui.wp-customizer .media-button {
		margin-top: 13px;
	}
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing this out! I’ve moved the max-width: 565px block above the max-width: 480px block to keep the media queries in order.

wporg-sync pushed a commit that referenced this pull request Nov 26, 2026
Increases the space between the "Filter by type", "Filter by date", and search labels and their fields in the media modal, with slightly more space on small screens.

Developed in #11927

Props ankitkumarshah, audrasjb, deeppatel8950, im3dabasia1, jns141191, masteradhoc, ravichudasama01, wildworks.
Fixes #65300.

git-svn-id: https://develop.svn.wordpress.org/trunk@65799 602fd350-edb4-49c9-b593-d223f7449a82
@github-actions

Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 65799
GitHub commit: c048d9f

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Nov 26, 2026
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Nov 26, 2026
Increases the space between the "Filter by type", "Filter by date", and search labels and their fields in the media modal, with slightly more space on small screens.

Developed in WordPress/wordpress-develop#11927

Props ankitkumarshah, audrasjb, deeppatel8950, im3dabasia1, jns141191, masteradhoc, ravichudasama01, wildworks.
Fixes #65300.
Built from https://develop.svn.wordpress.org/trunk@65799


git-svn-id: http://core.svn.wordpress.org/trunk@64828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants