-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try: add icons to media type dropdowns #8566
base: trunk
Are you sure you want to change the base?
Try: add icons to media type dropdowns #8566
Conversation
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. |
@argyleink any tips on showing the icon in the selected element at the top, do I need to handle that manually? (see note in PR description & screenshots) |
I got you: codepen doing exactly what you want
<button>
<selectedcontent></selectedcontent>
</button>
selectedcontent {
display: flex;
align-items: center;
gap: .5ch;
} you can also use this technique to have the selected state only show the icon |
Excellent, thank you! I suspected I was missing something. |
Description
The new Customizable Select API enables HTML select elements that can include images to make select elements more helpful for users.
This PR uses this new feature to add icons next to the media type dropdown in the media library.
Screenshots
Before PR
Before this PR, the media filter looks like this:
Grid view
List view
After PR
Grid view
List view
Notes
Trac ticket: None: this is an experiment so far.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.