Admin: replace dashicons in admin bar and sidebar with @wordpress/icons - #12270
Admin: replace dashicons in admin bar and sidebar with @wordpress/icons#12270fushar 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, |
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. |
ec0faf9 to
6ec651a
Compare
|
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. |
|
cc-ing (maybe) interested parties :) @t-hamano @jasmussen @tyxla @scruffian @lucasmendes-design |
|
These all appear to be solid like-for-like replacements, though I feel least supportive of the |
|
@jeffpaul Thanks for checking!
Yep, as noted in the PR description, I'm not sure about this as well.
You mean
But my worry is that the icon slug is not related to "site" at all. I would expect there is something like Another idea is to use this icon, to represent a "site switcher":
|
|
A few things from my end as I'm looking at this work:
|
|
@fushar yes the |
Thanks for the suggestion. I spent a good chunk of my day today trying to make this as a Gutenberg experiment. With the help of Claude, I (we) came up with this PR: WordPress/gutenberg#79588. Now, I understand that the changes are complicated, but I can't simplify it any further. Reasons:
Am I approaching this correctly? Or do you have better idea for a cleaner approach? Thanks! cc: @mcsf |
Hmm, this seems correct to me. There are side ways for achieving some of the things you mentioned, but not for others, unless we want to be super hacky. A bummer that this part of the menu is not as extensible as usual. Thank you for trying, though. Another way to get more attention on this would be to post a call for testing on the https://make.wordpress.org/core blog. |
I'd say so, at least for the purposes of a Gutenberg experiment. I left a comment or two in that PR. |
@jeffpaul: I agree that it looks better than a 2x2 grid. For the purpose of demonstration, I updated this PR to use that for the time being: |
|
@fcoveram: Thanks for the thorough testing!
Yeah, it is intentional. I'm not sure if it's the best way though. It's to achieve the same look and feel with the existing W dashicon. See the above image comparison, pasted here again:
Right now, if we use 22px, then the W logo is too small, because there's outer gap in the SVG. Maybe we need to fill the entire SVG box without any outer gap.
Yeah agree that 0.85 looks better. But I'm not sure if we can just update it only for the SVG icon. It's part of the Fresh color scheme; maybe we should do a separate PR to update the scheme 😄 |
|
All right everyone, thanks for taking a look. I want to summarize where we're at with this PR:
It feels like there's interest to push at least some parts of it in 7.1, and we're not that sure if we can achieve everything by 7.1. @t-hamano, what's your opinion on this? It seems you have the most context for all this icon API discussion 😄 cc: @tyxla, @mcsf, @scruffian. |
Leveraging the icon API for the dashboard icons is a great idea, and introducing a add_action( 'init', function () {
wp_unregister_icon_collection( 'core' );
}, 20 );add_action( 'init', function () {
wp_unregister_icon( 'core/info' );
}, 20 );In this case, what happens to the core menu icons registered by the icon API? This is my biggest concern. Here are the ideas I can come up with at the moment:
Do you have any other ideas? |
|
Thanks for taking a look.
Hmm interesting question. I would say, the last option (consider Otherwise, we will also need another way to get the SVG string for the admin bar icons as well, because in this PR I also use |
|
Noting that I'm responding here to some feedback on the core post, just to consolidate it all in one place. I will follow up and link to this comment from the comments. The feedback fell in two categories:
For this PR I think we should update the icons to what agreement is found as far as which icons to use, pin vs. verse, etc. As for the actual optical balance changes, upon agreement I will make a PR to the componentry source and we can then follow up shortly after with a new PR here. It's important to know the context and the followup, even if we do it in two phases. I tried to address as much as possible in the mockup below:
I personally think this one gets us closer as far as balance, though @mrwweb makes a good point that is notably visible in the bottom group of icons:
There's an aspect of the icons having organically built up separately, as also tracked here. As part of the effort to convert to stroke-based, however, small improvements have been made to a number of icons specifically to address the points raised there, and extending that set for this collection of main admin icons feels valid. For me what stands out is that there are many diagonal icons in the utility section that causes a bit of a mix. Here's an attempt at addressing this head on:
The rework of the plugins icon makes it immediately feel like it belongs next to tools and appearance. I'm not too sure about the new Media icon: I honestly prefer using something simpler like just a single "image" icon. But there is some value in recognition that's worth acknowledging. In defence of the "Verse": the following I want to acknowledge as good feedback:
Perhaps with a larger brush, the Verse icon can be reintroduced as it no longer looks similar. Nevertheless, the post type point is worth noting. I think of this as the quill pen icon, that happens to be used for the Verse block, and thus the connection between block and type didn't occur to me. WordPress may be the last bastion of the open web. Its users write, without arbitrary limitation from closed platforms, never locked in. There's some beauty to that which feels like poetry. So for me using the quill pen icon is more a matter of bringing that character into WordPress—code is poetry, after all. In the process of redrawing icons to be stroke-based, I also tried some stress tests to validate the point of stroke-based, namely that you can contextually set the weight:
It's likely not a UI we'll use anywhere—or could it become part of a mobile effort? In any case, next to "Page", the quill pen just looks beautiful to me. In any case, I'll be delighted for WordPress to get fresh energy on the icon side. For now, the main action item on these mockups is to agree on: which icons should we use? If we find agreement on those, I will follow up on the icon design changes based on that agreement and we can make a new PR. Is that fair? To note, a suggestion was to use the "styles" icon for the Apperance section. I tried that below, and I think it could work if also replacing some of the other utility icons. |
|
@jasmussen These changes all feel both very responsive to the overall feedback and like really meaningful improvements! The plugins icon feels especially better cleaned up and tilted 45 degrees! I like the direction of the new Media Library icon, though there's something about the music notes that is maybe slightly too heavy. (That's a super nit pick, and it feels much more cohesive than the old one). I also like the settings icon change that was suggested. Really nice work! I like your points in defense of the quill icon, writing, and the open web. I think there's something there. The new distinctive paintbrush icon solves what felt like the bigger of the two issues with the quill not being distinctive enough. Personally, I've never loved the pin icon either, so I like your idea of a change for Posts. I haven't thought about this deeply, but I wonder if a fountain pen icon could potentially have the same meaning without any risk of ambiguity? (Pencil is presumably still reserved for editing.) Here's a noun project icon purely as a directional composition idea that could use a 45 degree angle. |
Totally agree, beautiful! @fushar How does the before/after look for an RTL site? |
|
Thank you all for the feedback. Noting that for now I've updated the "after" image (including a tiny slipstreamed tweak to make the musical note in "media" ever so slightly smaller) on the general make/core post. In general I pledge to follow up on any details that emerge from conversation in followups—the fountain pen idea is a good one—though perhaps before I go much deeper it's better to give additional feedback a chance to land, and for Ashar to update this PR with the latest choices. I will then separately start to prep the new icons for inclusion in the library. Sound good? |
5eeeefb to
992648a
Compare
@jasmussen I updated this PR (and the screenshots) with I'll try to revive the Gutenberg PRs which are necessary to get the non-public icons in for this PR. |
|
Thanks. I will also follow up ASAP on the new and adjusted icons shown in this thread. |
Marks the 12 icons that WordPress/wordpress-develop#12270 adds to Core's icon library as `"public": false`: they are shipped and registered for server-side use, but stay out of the icons REST API and so out of the Icon block. brush, dashboard, link, media, page, pin, plugins, post, sites, tool, update, wordpress `false` rather than `true` because these are admin chrome, not post content. Promoting an icon later is trivial; demoting one is a breaking change.
99879b1 to
adccf47
Compare
Marks the 12 icons that WordPress/wordpress-develop#12270 adds to Core's icon library as `"public": false`: they are shipped and registered for server-side use, but stay out of the icons REST API and so out of the Icon block. brush, dashboard, link, media, page, pin, plugins, post, sites, tool, update, wordpress `false` rather than `true` because these are admin chrome, not post content. Promoting an icon later is trivial; demoting one is a breaking change.
Marks the icons that WordPress/wordpress-develop#12270 adds to Core's icon library as `"public": false`: they are shipped and registered for server-side use, but stay out of the icons REST API and so out of the Icon block. brush, dashboard, link, media, page, pin, plugins, post, sites, tool, update `wordpress` is the twelfth icon that Core PR needs. It is already flagged by #82634, which introduces the non-public state and uses it as its first consumer, so it is not repeated here. `false` rather than `true` because these are admin chrome, not post content. Promoting an icon later is trivial; demoting one is a breaking change.
Marks the icons that WordPress/wordpress-develop#12270 adds to Core's icon library as `"public": false`: they are shipped and registered for server-side use, but stay out of the icons REST API and so out of the Icon block. brush, dashboard, link, media, page, pin, plugins, post, sites, tool, update `wordpress` is the twelfth icon that Core PR needs. It is already flagged by #82634, which introduces the non-public state and uses it as its first consumer, so it is not repeated here. `false` rather than `true` because these are admin chrome, not post content. Promoting an icon later is trivial; demoting one is a breaking change.
adccf47 to
432c4ce
Compare
|
For anyone following along, the latest state of the PR can be tested using this special Playground link: https://playground.wordpress.net/?core-pr=12270&gutenberg-pr=79451 🙂 |
|
Re-tested this via the Playground link in the description (core PR + Gutenberg PR 79451), since core alone can't render this without the icon backport. Verified working:
One thing I suspected from reading the diff but disproved by testing: the CSS deletes several Suggestions (non-blocking):
Traced the icon-selection logic ( Nice work overall — only minor cleanup opportunities, nothing blocking. |
432c4ce to
417cc25
Compare
Marks the icons that WordPress/wordpress-develop#12270 adds to Core's icon library as `"public": false`: they are shipped and registered for server-side use, but stay out of the icons REST API and so out of the Icon block. brush, dashboard, link, media, page, pin, plugins, post, sites, tool, update `wordpress` is the twelfth icon that Core PR needs. It is already flagged by #82634, which introduces the non-public state and uses it as its first consumer, so it is not repeated here. `false` rather than `true` because these are admin chrome, not post content. Promoting an icon later is trivial; demoting one is a breaking change.
Marks the icons that WordPress/wordpress-develop#12270 adds to Core's icon library as `"public": false`: they are shipped and registered for server-side use, but stay out of the icons REST API and so out of the Icon block. brush, dashboard, link, media, page, pin, plugins, post, sites, tool, update `wordpress` is the twelfth icon that Core PR needs. It is already flagged by #82634, which introduces the non-public state and uses it as its first consumer, so it is not repeated here. `false` rather than `true` because these are admin chrome, not post content. Promoting an icon later is trivial; demoting one is a breaking change.
417cc25 to
c20c7e9
Compare
|
Something is not right, it seems the above Playground link is not serving the latest state of this PR (the Posts sidebar is showing blank instead of pin). Let me think... |














Trac ticket: https://core.trac.wordpress.org/ticket/65089
Warning
This PR needs this Gutenberg PR to work: WordPress/gutenberg#79451 (and later backported).
Until then, you can test it via this Playground link: https://playground.wordpress.net/?core-pr=12270&gutenberg-pr=79451
TODO: revert the "TEMPORARILY add non-public icons" commit after the backport lands.
This PR replaces the dashicons usage in admin bar and menu (sidebar) with
@wordpress/icons, via the newly-introducedwp_get_icon()function, which outputs an inline SVG to be rendered.New icon mapping
Admin bar
dashicons-wordpresscore/wordpressdashicons-menu-altcore/menudashicons-admin-multisitecore/sitesdashicons-dashboardcore/dashboarddashicons-admin-homecore/homeCustomize
dashicons-admin-appearancedashicons-admin-customizercore/brushdashicons-editcore/pencildashicons-pluscore/plusdashicons-admin-commentscore/commentdashicons-updatecore/updateCommand Palette
dashicons-searchcore/searchdashicons-admin-userscore/peopleAdmin menu (left sidebar)
For simplicity, only showing new items not present in the admin bar above.
dashicons-admin-postcore/pindashicons-admin-mediacore/mediadashicons-admin-linkscore/linkdashicons-admin-pagecore/pagedashicons-admin-pluginscore/pluginsdashicons-admin-toolscore/tooldashicons-admin-settingscore/settingsdashicons-admin-collapsecore/chevron-leftOpen questions
I'm not sure aboutMy Sitesicon. The closest thing that I think fits is thecore/gridicon (see screenshot below). Open to alternatives.Updated toUpdated tocore/block-metafor the time being, still open to alternatives.core/sitesfrom Icons: Add "sites" icon. gutenberg#80094.Screenshots
WP Admin
WP Admin - Multisite
Frontend
Before
After
Mobile
Before
After
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 4.8
Used for: code generation, with my supervision.
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.