Opened 8 months ago
Last modified 9 days ago
#64762 reopened defect (bug)
Frontend admin toolbar not using updated admin color scheme
| Reported by: | huzaifaalmesbah | Owned by: | audrasjb |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | Toolbar | Version: | |
| Severity: | normal | Keywords: | admin-reskin has-test-info has-patch has-unit-tests |
| Cc: | Focuses: | ui, css |
Description
On the frontend, the admin toolbar menu is not using the updated Admin Reskin color scheme.
The toolbar menu item still appears with the old color on hover.
For visual consistency, the frontend admin toolbar should use the updated admin design tokens and color scheme so that it matches the rest of the admin interface.
Steps to reproduce:
- Log in to WordPress.
- Visit the frontend of the site.
- Observe the admin toolbar menu styling.
Expected behavior:
The frontend admin toolbar menu item should follow the updated Admin Reskin color scheme for consistent UI across admin and frontend views.
Attachments (16)
Change History (113)
#4
follow-up:
↓ 13
@
7 months ago
- Keywords needs-patch added; 2nd-opinion removed
I've never understood or agreed with the reasons given in #26021 against using the admin colour scheme for the admin toolbar on the front end.
- Arguments about colour clashes are moot. There are plenty of dark themes that clash with the toolbar, and light/dark colour schemes are prevalent.
- Extra assets. The front end toolbar already loads admin-bar.css and dashicons.css. An extra stylesheet for the colour scheme is inconsequential compared to the 1,000+ lines of inline CSS output by the editor.
If we're going to facilitate the Modern colour scheme (which has been renamed to Default in 7.0) on the front end then we might as well facilitate all the available colour schemes.
I think for 7.0, support for the modern colour scheme must be added. Support for all other colour schemes can either come for free as part of that, or if there's still opposition then that can come at a later date.
#5
@
7 months ago
I think we should support all admin color schemes for the frontend toolbar. Currently, when a user changes the color scheme, the dashboard and the frontend toolbar look different. This creates an inconsistent experience and does not look good visually. Supporting the same color schemes on the frontend toolbar would make the UI more consistent across both the dashboard and the frontend.
#6
@
7 months ago
I concur with @johnbillion, it seems odd to be in the admin and have one set of colors/fonts/etc and then when you view the frontend of the site to potentially have a totally different set within the same adminbar. Aligning the frontend to the new admin color scheme feels like a step in correcting this odd UX.
#7
@
7 months ago
I agree with @johnbillion and @jeffpaul. Supporting the admin color scheme should apply to everything that's part of the admin, including the adminbar.
This ticket was mentioned in PR #11183 on WordPress/wordpress-develop by @huzaifaalmesbah.
7 months ago
#8
- Keywords has-patch added; needs-patch removed
Enqueue the user's selected admin color scheme CSS for the toolbar on the front end to ensure visual consistency with the admin dashboard.
Trac: https://core.trac.wordpress.org/ticket/64762
## Changes
- Registers admin color schemes on the front end if not already available.
- Enqueues the user's color scheme CSS with
admin-baras its sole dependency. - Supports all registered admin color schemes.
- Schemes without a CSS URL (e.g., Fresh) gracefully fall back to base styles.
## Testing Instructions
- Log in to WordPress.
- Go to Users → Profile and select different color schemes.
- Visit the frontend.
- Expected: The toolbar matches the selected color scheme.
@huzaifaalmesbah commented on PR #11183:
7 months ago
#9
#11
@
7 months ago
- Keywords has-dev-note added
@huzaifaalmesbah overall, this looks like a solid solution. I left some comments in your PR for you to review.
#13
in reply to: ↑ 4
@
7 months ago
Arguments about colour clashes are moot. There are plenty of dark themes that clash with the toolbar, and light/dark colour schemes are prevalent.
Clashes can occur because the color scheme stylesheets contain many rules in addition to the toolbar styles, including common elements that the theme might not override:
body, a, a:hover, a:active, a:focus, input[type=checkbox]:checked, input[type=radio]:checked, input[type=text]:focus, input[type=password]:focus, input[type=color]:focus, input[type=date]:focus, input[type=datetime]:focus, input[type=datetime-local]:focus, input[type=email]:focus, input[type=month]:focus, input[type=number]:focus, input[type=search]:focus, input[type=tel]:focus, input[type=time]:focus, input[type=url]:focus, input[type=week]:focus, select:focus, textarea:focus, input[type=checkbox]:focus, input[type=radio]:focus
My earlier suggestion in comment:2 also would have had that problem.
I'll add a pull request that tries to trim the stylesheet and add it as an inline style.
This ticket was mentioned in PR #11192 on WordPress/wordpress-develop by @sabernhardt.
7 months ago
#15
- Keywords has-unit-tests added
Adds CSS from admin color scheme stylesheets on the front end, as an inline style.
- Uses a separate function, which can be removed from the
admin_bar_initaction (and possibly deprecated later if stylesheets are replaced with CSS custom properties, etc.). - Updates PHPUnit test.
Props: huzaifaalmesbah
Use of AI Tools: none (by me)
@sabernhardt commented on PR #11192:
7 months ago
#16
Built with code from #11183
@huzaifaalmesbah commented on PR #11192:
7 months ago
#17
Looks good to me, and we got the expected result.
https://github.com/user-attachments/assets/bfba1fb5-c5ba-47d8-ae9d-4bb8de7fda7e
#18
@
7 months ago
Patch Testing Report
Patch Tested: https://github.com/WordPress/wordpress-develop/pull/11192
Environment
- WordPress: 7.0-beta3-20260306.170257
- PHP: 8.3.30
- Server: PHP.wasm
- Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.51.0)
- Browser: Chrome 145.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Five 1.4
- MU Plugins: None activated
- Plugins:
- Test Reports 1.2.1
Steps taken
- Log in to the admin dashboard.
- Visit the frontend.
- Observe the color of the admin toolbar ( with different Admin color schemes).
- ✅ Patch is solving the problem.
Expected result
- The admin toolbar now matches the chosen admin color scheme.
Additional Notes
- None
Screencast with results
Before:
https://files.catbox.moe/jpqf8o.mp4
After:
https://files.catbox.moe/6kyw6j.mp4
#19
@
7 months ago
Test Report
This Report Validates that the indicated patch address the issue.✅
Patch Tested: https://github.com/WordPress/wordpress-develop/pull/11192
Environment:
WordPress - 7.0-beta3-20260308.055323
OS - Windows
Browser - Chrome
Theme: Twenty Twenty Five
PHP - 8.2
Plugin - None
Actual Results:
- Issue Resolved with Patch ✅
Supplemental Artifacts
Before Patch: https://drive.google.com/file/d/1KXC9_Pok5wgP5rbJlCGAIILhqArMfSl2/view
After Patch: https://drive.google.com/file/d/1z9l2IBV1Ry4jGDyDiNb85LjdMveNCN2z/view
#20
@
7 months ago
- Keywords changes-requested removed
@SergeyBiryukov Please check how I edited the unit test.
#21
@
7 months ago
- Keywords commit added
Thanks for the PR @sabernhardt.
The unit test edits look good to me.
@audrasjb commented on PR #11192:
7 months ago
#23
Committed in https://core.trac.wordpress.org/changeset/62025
#24
@
7 months ago
- Keywords changes-requested added
- Resolution fixed
- Status closed → reopened
There seems to be a couple problems with r62025:
First, PHPStan is rightly identifying that $start_position could be false while $end_position is true. This is a problem since then it passes false into strpos() as well as doing $end_position - $start_position with a non-int value:
1476 Parameter #2 $start of function substr expects int, int<0, max>|false given.
🪪 argument.type
This patch seems to be needed:
-
src/wp-includes/admin-bar.php
diff --git a/src/wp-includes/admin-bar.php b/src/wp-includes/admin-bar.php index b9c7872d0c..be623baf9f 100644
a b function wp_admin_bar_add_color_scheme_to_front_end() { 1472 1472 if ( is_string( $css ) && str_contains( $css, '#wpadminbar' ) ) { 1473 1473 $start_position = strpos( $css, '#wpadminbar' ); 1474 1474 $end_position = strpos( $css, '.wp-pointer' ); 1475 if ( false !== $ end_position && $end_position > $start_position ) {1475 if ( false !== $start_position && false !== $end_position && $end_position > $start_position ) { 1476 1476 $css = substr( $css, $start_position, $end_position - $start_position ); 1477 1477 if ( SCRIPT_DEBUG ) { 1478 1478 $css = str_replace( '/* Pointers */', '', $css );
Secondly, I get a test failure when I try to test just the group in isolation:
$ npm run test:php -- --group=64762 There was 1 failure: 1) Tests_Dependencies_wpStyleLoaderSrc::test_without_wp_admin_css_colors_global Failed asserting that '' contains "/colors.css". /var/www/tests/phpunit/tests/dependencies/wpStyleLoaderSrc.php:28
It appears the test was passing before since some not-cleaned-up global is making is_admin() return true, so it doesn't enter both branches of the conditional in Tests_Dependencies_wpStyleLoaderSrc::test_without_wp_admin_css_colors_global().
A data provider needs to be added to test both when is_admin() and when not in the admin.
@westonruter commented on PR #11192:
7 months ago
#25
There are a couple problems I identified with this commit. Details: https://core.trac.wordpress.org/ticket/64762#comment:24
#26
@
7 months ago
- Keywords commit removed
If strpos( $css, '#wpadminbar' ) is false, then str_contains( $css, '#wpadminbar' ) also should be false. Then $start_position would not be defined and no CSS would be added.
I had trouble with the unit test just to make it pass in the GitHub action, so someone else would need to edit that.
This ticket was mentioned in PR #11255 on WordPress/wordpress-develop by @westonruter.
7 months ago
#27
#28
@
7 months ago
Ah, yes. I see that. In that case, better to just do the strpos( $css, '#wpadminbar' ) check instead of str_contains( $css, '#wpadminbar' ).
I was working on that, but then I found a more significant issue with the implementation: it was doing an HTTP request to obtain the color scheme CSS for every frontend page load. This resulted in the logic not working in the default Docker development environment where loopback requests are unfortunately broken (at least for me anyway), but it also is a performance problem. Query Monitor warns about this with each page load.
I've taken a stab in this PR to refactor the logic to not rely on HTTP requests but to load the file from the filesystem instead. Additionally, I've split the single test into two, one for the frontend and the other for the backend.
I admit I'm not fully familiar with the existing assertions or what the logic in wp_admin_bar_add_color_scheme_to_front_end() is supposed to be doing. I tried adding assertions to test that the existing logic is working as expected. I'm not sure what this assertion was supposed to be checking for originally:
<?php $this->assertFalse( wp_style_loader_src( '', 'colors' ) )
Or what this was asserting with r62025:
<?php $this->assertStringContainsString( '/colors.css', wp_style_loader_src( '', 'colors' ) );
The tests may fail, however, in GHA due to the files not being built. So the test may need to write a sample colors.css for test purposes, similar to how we have to touch files in other unit tests.
@sabernhardt I'll invite you to my fork so you can push up additional commits.
@westonruter commented on PR #11255:
7 months ago
#29
#30
@
7 months ago
Sorry but this implementation falls quite short of what I would expect it to.
- Why is a server-side HTTP request being performed on every front end page load to fetch the CSS file? Can the file not be loaded from the filesystem?
- Pulling out a substring from the stylesheet seems fragile.
I appreciate that we're trying to squeeze this into 7.0 but there are Sass files with the source colours for each colour scheme available in wp-admin/css/colors and a colors task in Gruntfile.js to generate the stylesheets.
Can the task be updated to generate a separate stylesheet that just overrides the necessary admin bar colours with those from each colour scheme?
This ticket was mentioned in PR #11267 on WordPress/wordpress-develop by @johnbillion.
7 months ago
#31
This extracts the admin toolbar styles into a mixin so a standalone admin-bar.css file can be generated for each colour scheme. Facilitates custom colour schemes registering their own admin toolbar CSS file too.
Trac ticket: https://core.trac.wordpress.org/ticket/64762
## Use of AI Tools
Claude Code was used to initialise the separate admin bar color Sass files for each colour scheme. Worked ok-ish, I subsequently manually adjusted a lot of it.
#32
@
7 months ago
I've taken a punt at this in https://github.com/WordPress/wordpress-develop/pull/11267.
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
7 months ago
@andrewssanya commented on PR #11183:
7 months ago
#34
@audrasjb commented on PR #11267:
7 months ago
#35
Thanks for putting together this PR @johnbillion! It looks fairly better than the current implementation.
I tested the PR on my side, and admin bar styles are correctly implemented on front end when we switch admin color schemes.
@sabernhardt commented on PR #11267:
7 months ago
#36
I was having trouble with the registered schemes for bbPress and Grey Admin Color Schemes because both plugins use wp_admin_css_color() within the admin_init hook.
- Switching the hook to
initworks for me on the front and back with Grey Admin Color Schemes and adding the fifth and sixth arguments.wp_admin_css_color( 'postmodern', __('Post Modern Grey', 'grey-admin-color-schemes'), plugins_url("postmodern/colors$rtl.css", __FILE__ ), array( '#464646', '#6D6D6D', '#D6D6D6', '#F1F1F1' ), array(), plugins_url("postmodern/admin-bar.css", __FILE__ ) ); - bbPress would need more editing, and I have not solved that on the front.
#37
@
7 months ago
Test Report
Description
Frontend admin toolbar not using updated admin color scheme
This report validates whether the indicated patch works as expected.
Patch tested: REPLACE_WITH_PATCH_URL
Environment
- WordPress: 7.0-alpha-61215-src
- PHP: 8.5.4
- Server: nginx/1.29.5
- Database: mysqli (Server: 8.4.8 / Client: mysqlnd 8.5.4)
- Browser: Chrome 146.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Five 1.4
- MU Plugins: None activated
- Plugins:
- Test Reports 1.2.1
Actual Results
- ✅ Issue resolved with patch.
This ticket was mentioned in PR #11354 on WordPress/wordpress-develop by @sabernhardt.
7 months ago
#38
Alternative option to https://github.com/WordPress/wordpress-develop/pull/11267 that uses the same Sass and built stylesheets but avoids using the $_wp_admin_css_colors global variable.
- Reverts the unit test to its original code.
- Does not enqueue a stylesheet for the Fresh color scheme.
- Enqueues an external stylesheet for the other 8 core schemes on the front end.
- Does not attempt to support plugins' color schemes on the front.
## Use of AI Tools
@johnbillion shared these details:
Claude Code was used to initialise the separate admin bar color Sass files for each colour scheme. Worked ok-ish, I subsequently manually adjusted a lot of it.
#39
@
7 months ago
- Keywords changes-requested removed
I was able to add Grey Admin Color Schemes on the front with PR 11267, but I would be more confident in that patch if someone could add color schemes from either bbPress or Jetpack on the front.
I submitted PR 11354 as an alternative option to consider, in case PR 11267 is not yet ready for this release.
#40
@
7 months ago
Test Report
Patch tested: https://github.com/WordPress/wordpress-develop/pull/11354
Environment
- WordPress: 7.0-RC1-20260326.042417
- PHP: 7.4.33
- Server: PHP.wasm
- Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.51.0)
- Browser: Chrome 146.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Five 1.4
- MU Plugins: None activated
- Plugins:
- Test Reports 1.2.1
Actual Results
- ✅ Issue resolved with patch.
Video Link: https://vimeo.com/1177957494/aa513bbd90
#41
@
7 months ago
Test Report
Description
I've tested using WordPress Playground (https://playground.wordpress.net/wordpress.html?pr=11354) and can confirm the issue is resolved.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/11354
Environment
- WordPress: 7.0-RC1-20260326.042417
- PHP: 8.3.30
- Server: PHP.wasm
- Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.51.0)
- Browser: Chrome 146.0.0.0
- OS: macOS
- Theme: Twenty Twenty-Five 1.4
- MU Plugins: None activated
- Plugins:
- Test Reports 1.2.1
Actual Results
- ✅ Issue resolved with patch.
Supplemental Artifacts
Color Scheme LIGHT in wp-admin

Color Scheme LIGHT on Frontend

Color Scheme SUNRISE in wp-admin

Color Scheme SUNRISE on Frontend

Color Scheme ECTOPLASM in wp-admin

Color Scheme ECTOPLASM on Frontend

This ticket was mentioned in Slack in #core-test by r1k0. View the logs.
6 months ago
#43
@
6 months ago
Patch Testing Report
Patch Tested: https://github.com/WordPress/wordpress-develop/pull/11354
Environment
- WordPress: 7.0-beta6-62085-src
- PHP: 8.3.30
- Server: nginx/1.29.7
- Database: MySQL 8.4.8
- Browser: Brave
- OS: Ubuntu 24.04
- Theme: Twenty Twenty-Five 1.4
- MU Plugins: None
- Plugins: None
Steps Taken
- Went to Users > Profile and set color scheme to Sunrise.
- Visited the frontend. Before patch: Toolbar showed default black colors.
- Applied PR #11354 and hard refreshed. After patch: Toolbar matched Sunrise colors.
- Switched to Ectoplasm, saved, hard refreshed. After patch: Toolbar matched Ectoplasm colors.
✅ Patch is solving the problem
Expected Result
The frontend admin toolbar should match the color scheme selected in the user profile.
Additional Notes
- On 7.0-beta6 without the patch, the toolbar stays black on the frontend no matter what color scheme is set in the admin.
- Tested Sunrise and Ectoplasm. Both worked after the patch.
Screenshots/Screencast with results
@swissspidy commented on PR #11255:
6 months ago
#44
Thanks for working on this! I was perplexed why there was suddenly an extra HTTP request on very page by this function. 🤦
#46
@
6 months ago
Patch Report
Patch Tested: https://github.com/WordPress/wordpress-develop/pull/11354
Environment
WordPress: 7.0-RC1-20260326.042417
PHP: 7.4.33
Browser: Chrome
OS: Mac
Patch is working fine ✅
Expected result
The admin toolbar now matches the chosen admin color scheme.
Screenshot:
#47
@
6 months ago
For the 7.0 release, it might be better to ship PR 11354, which has a minimal approach.
This ticket was mentioned in Slack in #core by jorbin. View the logs.
5 months ago
#49
follow-up:
↓ 50
@
5 months ago
- Keywords 2nd-opinion added
Each of these proposed solutions is a fairly large, and we are only two days away from the new beta 1. I think reverting [62025] and punting this to 7.1 is the safest solution.
#50
in reply to: ↑ 49
@
5 months ago
- Keywords 2nd-opinion removed
Replying to jorbin:
Each of these proposed solutions is a fairly large, and we are only two days away from the new beta 1. I think reverting [62025] and punting this to 7.1 is the safest solution.
I tend to agree with this. Since this element has not matched the color scheme in the past, I think it's not surprising to a user if it does not after updating. Reverting gives us more time to find a better solution to this.
If we could find a minimal way to change the admin bar solely in the admin and leave it as it was in 6.9 on the front end for 7.0, I think that I would be in favor of that as an incremental step. But given that we're now less than 24 hours from the next pre-release, it's getting down to the wire.
This ticket was mentioned in PR #11771 on WordPress/wordpress-develop by @wildworks.
5 months ago
#51
Trac ticket: https://core.trac.wordpress.org/ticket/64762
## Use of AI Tools
#52
@
5 months ago
One drawback of reverting [62025] is that it causes a color theme mismatch between the frontend and backend. Specifically, the backend will use modern colors while the frontend will be stuck with the legacy fresh colors. This default color discrepancy did not occur in 6.9. As a more conservative approach, I've tried a PR that simply changes the frontend color theme to modern colors.
#53
@
5 months ago
I would prefer to revert [62025], even if the ticket stays in 7.0 (or moves to 7.1 and back to 7.0 if a patch is ready in time). Then the differences from 6.9 would be clearer.
PR that simply changes the frontend color theme to modern colors.
Anyone who purposely returns to the Fresh scheme should not have the Modern scheme CSS.
#54
@
5 months ago
PR that simply changes the frontend color theme to modern colors.
Anyone who purposely returns to the Fresh scheme should not have the Modern scheme CSS.
You're right. Indeed, it seems best to revert [62025] for now.
@wildworks commented on PR #11771:
5 months ago
#55
Closing this based on https://core.trac.wordpress.org/ticket/64762#comment:53
This ticket was mentioned in PR #11783 on WordPress/wordpress-develop by @wildworks.
5 months ago
#56
This reverts commit 421ac3612c1d221bcb930c29ac3a9252ed25d328 (r62025).
Trac ticket: https://core.trac.wordpress.org/ticket/64762
## Use of AI Tools
None
#60
@
5 months ago
- Keywords dev-reviewed added; dev-feedback removed
Marking as dev-reviewed. Let's backport [62349] to branch 7.0.
#62
@
5 months ago
- Keywords has-screenshots has-patch has-unit-tests fixed-major dev-reviewed removed
- Milestone 7.0 → 7.0.1
I backported the [62349] revert to 7.0. Moving this ticket to 7.0.1 for further development.
#63
@
5 months ago
Removing trunk version as this is not going to be shipped with WP 7.0 but in the next releases.
@wildworks commented on PR #11783:
4 months ago
#68
This PR has already been committed. https://core.trac.wordpress.org/changeset/62349
@wildworks commented on PR #11267:
4 months ago
#69
Now that 7.0 has been released, I believe we can resume this PR towards 7.1.
#70
@
4 months ago
- Milestone 7.0.1 → 7.1
With PR #11267 looking like the best path forward and that PR adding new files which can't be done in a minor release, I am moving this to 7.1.
#71
@
3 months ago
Since Admin color scheme reflected in the Site Editor has landed for WordPress 7.1, I think this ticket would complement that work nicely. Having the frontend admin toolbar respect the selected admin color scheme would provide a more consistent experience across the Site Editor, wp-admin, and the frontend.
If everyone has the bandwidth to work on it, I'd love to see this land in 7.1 as well.
This ticket was mentioned in Slack in #core-test by noruzzaman. View the logs.
3 months ago
This ticket was mentioned in Slack in #core by adrianduffell. View the logs.
2 months ago
@
2 months ago
After patch (page source showing admin-bar-color-scheme-css loading colors/sunrise/admin-bar.css)
#74
@
2 months ago
Patch Testing Report
Patch tested: https://github.com/WordPress/wordpress-develop/pull/11267
Tested the PR branch directly at commit 8a7542d6aa. This reflects the state of the branch from March, which is why the version string below reports as 7.0-beta5 and not current trunk.
Environment
- WordPress: 7.0-beta5-61991-src
- Subdirectory: No
- PHP: 8.3.32
- Server: nginx/1.31.3
- Database: mysqli (Server: 9.7.1 / Client: mysqlnd 8.3.32)
- Browser: Chrome 150.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Five 1.4
- MU Plugins: None activated
- Plugins:
- Test Reports 1.3.0
Steps taken
- Cleaned trunk to commit 07220f23b7 and ran
npm run build:dev. - Set profile color scheme to Sunrise and checked the frontend toolbar.
- Set profile color scheme to Ectoplasm and checked the frontend toolbar.
- Checked the page source on trunk to verify the current stylesheet behavior.
- Fetched upstream pull/11267/head, checked it out, and rebuilt.
- Set each of the four schemes, checking the frontend toolbar and page source for each.
- ✅ Patch is solving the problem: The frontend toolbar now matches the selected admin scheme, and a per-scheme stylesheet is enqueued on the front end.
Expected result
- The frontend toolbar should visually match the color scheme chosen in the user profile.
Additional Notes
| Scheme | Front-end toolbar | admin-bar-color-scheme-css | Stylesheet |
|---|---|---|---|
| Default | matches wp-admin | present | colors/modern/admin-bar.css
|
| Fresh | matches wp-admin | absent | — |
| Sunrise | matches wp-admin | present | colors/sunrise/admin-bar.css
|
| Ectoplasm | matches wp-admin | present | colors/ectoplasm/admin-bar.css
|
- Fresh scheme: no extra stylesheet is enqueued.
- Default scheme loads the stylesheet from the
modern/directory. - The "Howdy, admin" submenu now properly follows the scheme; on trunk, it stayed dark.
- The PR branch is based on trunk from before [62349] and currently has conflicts. The last CI run was 16 March, meaning its logs and Playground artifact have expired.
Screenshots with results
Before:
After:
@softglaze commented on PR #11267:
2 months ago
#75
I tested this branch locally at commit "8a7542d6aa". Default, Sunrise and Ectoplasm each enqueue their own admin-bar.css on the front end and the toolbar matches the selected admin scheme. Fresh enqueues no stylesheet. Note the branch can't currently be previewed via Playground (the CI artifact has expired).
This ticket was mentioned in Slack in #core by softglaze. View the logs.
2 months ago
@johnbillion commented on PR #11267:
2 months ago
#77
@softglazee @fushar Appreciate your testing but I think #11354 supersedes this now. Are you able to take a look?
@softglaze commented on PR #11267:
2 months ago
#78
@johnbillion yes, i'm going to test #11354, and thank you
#79
@
2 months ago
- Keywords has-test-info added
Patch Testing Report
Patch tested: https://github.com/WordPress/wordpress-develop/pull/11354
Environment
- WordPress: 7.0-RC1-62111-src
- Subdirectory: No
- PHP: 8.3.32
- Server: nginx/1.31.3
- Database: mysqli (Server: 9.7.1 / Client: mysqlnd 8.3.32)
- Browser: Chrome 150.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Five 1.5
- MU Plugins: None activated
- Plugins:
- Test Reports 1.3.0
- Gutenberg: not installed
Tested the PR branch at 794875760a (25 March), which is why the version string reads 7.0-RC1-62111-src. This is a different March snapshot from PR 11267.
Steps taken
- Cleaned trunk to commit 5bc2c6228c and ran build.
- Fetched pull/11354/head, checked out 794875760a, and rebuilt.
- Confirmed both
admin-bar.css(4329 bytes) andadmin-bar.min.css(3926 bytes) are successfully generated by the Grunt task for each scheme. - Checked all nine options in the profile in the front-end page source.
- Turned
SCRIPT_DEBUGoff, then rechecked the front-end source and Network tab for the minified path. - Installed the "Grey Admin Color Schemes" plugin, tested its three schemes, and re-tested a core scheme while the plugin was active.
- ✅ Patch is solving the problem: Core schemes successfully enqueue their front-end styles (handling both minified and non-minified paths), and custom plugin schemes fall back safely without breaking.
Expected result
- The front-end toolbar should enqueue the correct stylesheet based on the selected core scheme and
SCRIPT_DEBUGstatus.
Additional Notes
| Scheme | admin-bar-color-scheme-css | Stylesheet |
|---|---|---|
| Modern (Default) | present | colors/modern/admin-bar.css
|
| Light | present | colors/light/admin-bar.css
|
| Blue | present | colors/blue/admin-bar.css
|
| Coffee | present | colors/coffee/admin-bar.css
|
| Ectoplasm | present | colors/ectoplasm/admin-bar.css
|
| Midnight | present | colors/midnight/admin-bar.css
|
| Ocean | present | colors/ocean/admin-bar.css
|
| Sunrise | present | colors/sunrise/admin-bar.css
|
| Fresh | absent | — |
- With
SCRIPT_DEBUGoff, the source correctly requestsadmin-bar.min.css. The file returns a 200 OK and transfers 4.2 kB, confirming the production path works. - For all three plugin-registered schemes (from Grey Admin Color Schemes), no stylesheet is enqueued on the front end. The toolbar gracefully falls back to the default dark style with no breakage.
- Core schemes continue to work (1/1 stylesheet enqueued) even while the color scheme plugin is active.
- The function returns early on
is_admin(), meaning this logic is strictly front-end only.site-editor.phpshows no stylesheet enqueued, which is the expected behavior. - Note: fushar raised a color question on PR 11267, and it is worth noting that PR 11354 contains the exact same Sass commits (3700f88 and 8a7542d) from PR 11267.
Screenshots with results
- 11354-after-plugin-scheme-source-no-stylesheet.png
- 11354-after-plugin-scheme-frontend-fallback.png
- 11354-after-core-scheme-works-with-plugin-active.png
- 11354-after-sunrise-source-scriptdebug-off-min-css.png
- 11354-after-sunrise-min-css-loads-200.png
- 11354-after-fresh-source-no-stylesheet.png
- 11354-after-ectoplasm-frontend.png
@softglaze commented on PR #11354:
2 months ago
#80
I have tested this branch locally at commit 794875760a. Here is the detailed breakdown of the behavior:
- Core Schemes: Modern, Light, Blue, Coffee, Ectoplasm, Midnight, Ocean, and Sunrise all correctly enqueue their respective
colors/{scheme}/admin-bar.csson the front end. Fresh enqueues no stylesheet, as expected. - Production Path (
SCRIPT_DEBUGoff): The Grunt task successfully builds both variants. WhenSCRIPT_DEBUGis false, the source correctly requestsadmin-bar.min.css, which returns a 200 OK (4.2 kB transferred). - Plugin Schemes (Fallback Behavior): I tested this against the "Grey Admin Color Schemes" plugin. For plugin-registered schemes, no stylesheet is enqueued on the front end, and the toolbar safely falls back to the default dark style without any breakage. Core schemes remain unaffected and continue to work while the plugin is active.
- Site Editor: The function correctly returns early on
is_admin(), so the stylesheet is not loaded insite-editor.php.
Full test report and screenshots have been posted on Trac #64762.
@softglaze commented on PR #11267:
2 months ago
#81
Just a heads-up that I have fully tested PR 11354 as requested. You can find the complete test report, including how it handles plugin-registered schemes and the minified production path, over on Trac #64762.
#83
@
2 months ago
- Milestone 7.1 → 7.2
Both pull requests have conflicts to resolve because the toolbar styles have changed since March, and #65445 might change the styles again this week. Two days is not enough for both tickets (and maybe not enough for either ticket).
@fushar commented on PR #11354:
3 weeks ago
#84
Let's get this to the finish line for 7.2! @sabernhardt, would you like to continue working on this? I have spare bandwidth to help if not.
@wildworks commented on PR #11354:
3 weeks ago
#85
@fushar, if you have the bandwidth, please feel free to go ahead with this. We only have a month left until 7.2 Beta 1, which might seem like a long time, but it really isn't much time at all 😄
This ticket was mentioned in PR #13806 on WordPress/wordpress-develop by @fushar.
2 weeks ago
#86
- Keywords has-patch has-unit-tests added
Trac ticket: https://core.trac.wordpress.org/ticket/64762
Follow-up to: https://github.com/WordPress/wordpress-develop/pull/11354 by @sabernhardt.
This PR enqueues a small CSS in the logged-in frontend pages so that the admin bar is shown using the current admin bar color scheme.
The improvements over the linked PR are as follows.
- This PR is now rebased on top of latest upstream trunk.
- Instead of having a second hardcoded list of core schemes (minus
fresh), this PR simply checks for the existence of the newly builtadmin-barCSS file usingfile_exists(). - This PR avoids color duplication between
colors.scssandadmin-bar.scssby extracting the color definition into a shared_scheme.scsspartial.
I also tried to resolve all review comments from the original PR.
I tested this PR using Core color schemes and plugin's (such as Sleeker Admin Color Schemes) and it works fine!
Use of AI Tools
Used Claude Opus 5.5 to rebase the original PR and brainstorm solutions for improvements.
@fushar commented on PR #11354:
2 weeks ago
#87
Since I can't push to the fork, I opened a new PR instead. Rebased and continued the improvements here: https://github.com/WordPress/wordpress-develop/pull/13806
@fushar commented on PR #13806:
2 weeks ago
#88
Tagging reviewers: @sabernhardt, @t-hamano, @westonruter 🙂
@wildworks commented on PR #11354:
2 weeks ago
#89
Closing this in favor of #13806
@fushar commented on PR #13806:
2 weeks ago
#90
I tested this PR using Core color schemes and plugin's (such as Sleeker Admin Color Schemes) and it works fine!
Does this mean the plugin-defined color scheme is properly applied to the front end? Based on what I checked with the AI, this doesn't seem to be true.
Sorry, it was bad phrasing from me. I meant when using a plugin-defined scheme, it does not enqueue the CSS as expected (as per the old PR's behavior) 🤦
@fushar commented on PR #13806:
2 weeks ago
#91
With the current implementation, custom color schemes registered by plugins via wp_admin_css_color() are not applied to the admin bar on the front end. Most plugins register their color schemes on admin_init, so the registered data isn't available on the front end.
Even if we encouraged plugins to register them on init instead, the registered stylesheet targets the entire dashboard and includes generic selectors such as body and a. Loading it as-is on the front end would affect the theme's appearance.
Right, this is an unsolved problem right now. One solution is to allow wp_admin_css_color() to receive an admin bar CSS as a new arg, which Core will enqueue on frontend screen like this PR does. Note that we also have this issue https://core.trac.wordpress.org/ticket/65776 that proposes adding more args to allow passing color seeds. It looks like it's better if these issues are solved together later 🙂
@fushar commented on PR #13806:
2 weeks ago
#92
One solution is to allow wp_admin_css_color() to receive an admin bar CSS as a new arg, which Core will enqueue on frontend screen like this PR does.
I explored this solution. Something like this:
<details>
<summary>Click to open</summary>
-
src/wp-includes/admin-bar.php
diff --git i/src/wp-includes/admin-bar.php w/src/wp-includes/admin-bar.php index c847c8994c..c23fce361e 100644
i w function _get_admin_bar_pref( $context = 'front', $user = 0 ) { 1491 1491 * Enqueues the admin bar color scheme stylesheet on the front end if present. 1492 1492 * 1493 1493 * @since 7.2.0 1494 * 1495 * @global array $_wp_admin_css_colors 1494 1496 */ 1495 1497 function wp_enqueue_admin_bar_color_scheme_styles() { 1498 global $_wp_admin_css_colors; 1499 1496 1500 if ( is_admin() ) { 1497 1501 return; 1498 1502 } 1499 1503 1504 $registered_color_schemes = $_wp_admin_css_colors ?? array(); 1505 register_admin_color_schemes(); 1506 $_wp_admin_css_colors = array_merge( $_wp_admin_css_colors, $registered_color_schemes ); 1507 1500 1508 $color_scheme = get_user_option( 'admin_color' ); 1501 if ( empty( $color_scheme ) ) {1509 if ( empty( $color_scheme ) || ! isset( $_wp_admin_css_colors[ $color_scheme ] ) ) { 1502 1510 $color_scheme = 'modern'; 1503 1511 } 1504 1512 1505 if ( sanitize_key( $color_scheme ) !== $color_scheme ) { 1506 return; 1507 } 1508 1509 $suffix = SCRIPT_DEBUG ? '' : '.min'; 1510 $path = "css/colors/{$color_scheme}/admin-bar{$suffix}.css"; 1511 1512 if ( ! file_exists( ABSPATH . 'wp-admin/' . $path ) ) { 1513 $admin_bar_url = $_wp_admin_css_colors[ $color_scheme ]->admin_bar_url ?? ''; 1514 if ( ! $admin_bar_url ) { 1513 1515 return; 1514 1516 } 1515 1517 1516 1518 wp_enqueue_style( 1517 1519 'admin-bar-color-scheme', 1518 admin_url( $path ),1520 $admin_bar_url, 1519 1521 array( 'admin-bar' ) 1520 1522 ); 1521 1523 } -
src/wp-includes/general-template.php
diff --git i/src/wp-includes/general-template.php w/src/wp-includes/general-template.php index 73178b9eca..6c0b24db24 100644
i w function paginate_links( $args = '' ) { 5177 5177 * '#07273E', '#14568A', '#D54E21', '#2683AE' 5178 5178 * ) ); 5179 5179 * 5180 * Alternatively, the third argument can be an array of arguments: 5181 * 5182 * wp_admin_css_color( 5183 * 'classic', 5184 * __( 'Classic' ), 5185 * array( 5186 * 'url' => plugins_url( 'css/colors.css', __FILE__ ), 5187 * 'admin_bar_url' => plugins_url( 'css/admin-bar.css', __FILE__ ), 5188 * ), 5189 * array( '#07273E', '#14568A', '#D54E21', '#2683AE' ) 5190 * ); 5191 * 5192 * To apply the color scheme to the admin bar on the front end, the color scheme 5193 * must be registered on the front end too. 5194 * 5180 5195 * @since 2.5.0 5196 * @since 7.2.0 The `$url` parameter can be an array of arguments. 5181 5197 * 5182 5198 * @global array $_wp_admin_css_colors 5183 5199 * 5184 * @param string $key The unique key for this theme. 5185 * @param string $name The name of the theme. 5186 * @param string $url The URL of the CSS file containing the color scheme. 5187 * @param array $colors Optional. An array of CSS color definition strings which are used 5188 * to give the user a feel for the theme. 5189 * @param array $icons { 5200 * @param string $key The unique key for this theme. 5201 * @param string $name The name of the theme. 5202 * @param string|array $url { 5203 * The URL of the CSS file containing the color scheme, or an array of arguments. 5204 * 5205 * @type string $url Optional. The URL of the CSS file containing the color scheme. 5206 * @type string $admin_bar_url Optional. The URL of the CSS file containing the color scheme 5207 * for the admin bar only, loaded on the front end. It should only 5208 * contain styles scoped to `#wpadminbar`. 5209 * } 5210 * @param array $colors Optional. An array of CSS color definition strings which are used 5211 * to give the user a feel for the theme. 5212 * @param array $icons { 5190 5213 * Optional. CSS color definitions used to color any SVG icons. 5191 5214 * 5192 5215 * @type string $base SVG icon base color. … … function wp_admin_css_color( $key, $name, $url, $colors = array(), $icons = arra 5201 5224 $_wp_admin_css_colors = array(); 5202 5225 } 5203 5226 5227 $args = wp_parse_args( 5228 is_array( $url ) ? $url : array( 'url' => $url ), 5229 array( 5230 'url' => '', 5231 'admin_bar_url' => '', 5232 ) 5233 ); 5234 5204 5235 $_wp_admin_css_colors[ $key ] = (object) array( 5205 'name' => $name, 5206 'url' => $url, 5207 'colors' => $colors, 5208 'icon_colors' => $icons, 5236 'name' => $name, 5237 'url' => $args['url'], 5238 'admin_bar_url' => $args['admin_bar_url'], 5239 'colors' => $colors, 5240 'icon_colors' => $icons, 5209 5241 ); 5210 5242 } 5211 5243 … … function wp_admin_css_color( $key, $name, $url, $colors = array(), $icons = arra 5220 5252 * @since 3.0.0 5221 5253 */ 5222 5254 function register_admin_color_schemes() { 5223 $ suffix = is_rtl() ? '-rtl' : '';5224 $suffix .= SCRIPT_DEBUG ? '' : '.min';5255 $min_suffix = SCRIPT_DEBUG ? '' : '.min'; 5256 $suffix = ( is_rtl() ? '-rtl' : '' ) . $min_suffix; 5225 5257 5226 5258 wp_admin_css_color( 5227 5259 'modern', 5228 5260 _x( 'Default', 'admin color scheme' ), 5229 admin_url( "css/colors/modern/colors$suffix.css" ), 5261 array( 5262 'url' => admin_url( "css/colors/modern/colors$suffix.css" ), 5263 'admin_bar_url' => admin_url( "css/colors/modern/admin-bar$min_suffix.css" ), 5264 ), 5230 5265 array( '#1e1e1e', '#3858e9', '#7b90ff' ), 5231 5266 array( 5232 5267 'base' => '#f3f1f1', … … function register_admin_color_schemes() { 5250 5285 wp_admin_css_color( 5251 5286 'light', 5252 5287 _x( 'Light', 'admin color scheme' ), 5253 admin_url( "css/colors/light/colors$suffix.css" ), 5288 array( 5289 'url' => admin_url( "css/colors/light/colors$suffix.css" ), 5290 'admin_bar_url' => admin_url( "css/colors/light/admin-bar$min_suffix.css" ), 5291 ), 5254 5292 array( '#e5e5e5', '#6a6a6a', '#c64606', '#007cba' ), 5255 5293 array( 5256 5294 'base' => '#999', … … function register_admin_color_schemes() { 5262 5300 wp_admin_css_color( 5263 5301 'blue', 5264 5302 _x( 'Blue', 'admin color scheme' ), 5265 admin_url( "css/colors/blue/colors$suffix.css" ), 5303 array( 5304 'url' => admin_url( "css/colors/blue/colors$suffix.css" ), 5305 'admin_bar_url' => admin_url( "css/colors/blue/admin-bar$min_suffix.css" ), 5306 ), 5266 5307 array( '#183751', '#245278', '#437aa8', '#e1a948' ), 5267 5308 array( 5268 5309 'base' => '#e5f8ff', … … function register_admin_color_schemes() { 5274 5315 wp_admin_css_color( 5275 5316 'midnight', 5276 5317 _x( 'Midnight', 'admin color scheme' ), 5277 admin_url( "css/colors/midnight/colors$suffix.css" ), 5318 array( 5319 'url' => admin_url( "css/colors/midnight/colors$suffix.css" ), 5320 'admin_bar_url' => admin_url( "css/colors/midnight/admin-bar$min_suffix.css" ), 5321 ), 5278 5322 array( '#232a2e', '#333c42', '#69a8bb', '#cf4339' ), 5279 5323 array( 5280 5324 'base' => '#f1f2f3', … … function register_admin_color_schemes() { 5286 5330 wp_admin_css_color( 5287 5331 'sunrise', 5288 5332 _x( 'Sunrise', 'admin color scheme' ), 5289 admin_url( "css/colors/sunrise/colors$suffix.css" ), 5333 array( 5334 'url' => admin_url( "css/colors/sunrise/colors$suffix.css" ), 5335 'admin_bar_url' => admin_url( "css/colors/sunrise/admin-bar$min_suffix.css" ), 5336 ), 5290 5337 array( '#6f2724', '#8a312d', '#ad631e', '#ccaf0b' ), 5291 5338 array( 5292 5339 'base' => '#f3f1f1', … … function register_admin_color_schemes() { 5298 5345 wp_admin_css_color( 5299 5346 'ectoplasm', 5300 5347 _x( 'Ectoplasm', 'admin color scheme' ), 5301 admin_url( "css/colors/ectoplasm/colors$suffix.css" ), 5348 array( 5349 'url' => admin_url( "css/colors/ectoplasm/colors$suffix.css" ), 5350 'admin_bar_url' => admin_url( "css/colors/ectoplasm/admin-bar$min_suffix.css" ), 5351 ), 5302 5352 array( '#392751', '#4a3369', '#646c3e', '#d46f15' ), 5303 5353 array( 5304 5354 'base' => '#ece6f6', … … function register_admin_color_schemes() { 5310 5360 wp_admin_css_color( 5311 5361 'ocean', 5312 5362 _x( 'Ocean', 'admin color scheme' ), 5313 admin_url( "css/colors/ocean/colors$suffix.css" ), 5363 array( 5364 'url' => admin_url( "css/colors/ocean/colors$suffix.css" ), 5365 'admin_bar_url' => admin_url( "css/colors/ocean/admin-bar$min_suffix.css" ), 5366 ), 5314 5367 array( '#2b3f44', '#39535a', '#567958', '#aa9d88' ), 5315 5368 array( 5316 5369 'base' => '#f2fcff', … … function register_admin_color_schemes() { 5322 5375 wp_admin_css_color( 5323 5376 'coffee', 5324 5377 _x( 'Coffee', 'admin color scheme' ), 5325 admin_url( "css/colors/coffee/colors$suffix.css" ), 5378 array( 5379 'url' => admin_url( "css/colors/coffee/colors$suffix.css" ), 5380 'admin_bar_url' => admin_url( "css/colors/coffee/admin-bar$min_suffix.css" ), 5381 ), 5326 5382 array( '#382e27', '#5c4c40', '#916745', '#9ea476' ), 5327 5383 array( 5328 5384 'base' => '#f3f2f1',
</details>
Plugins would register the scheme at init as follows:
add_action( 'init', function () { wp_admin_css_color( 'demo', 'Demo, array( 'url' => plugins_url( 'demo-admin-color-scheme/colors.css', __FILE__ ), 'admin_bar_url' => plugins_url( 'demo-admin-color-scheme/admin-bar.css', __FILE__ ), ), array( '#3b1f4f', '#2c173b', '#e05d9a', '#f2b134' ), array( 'base' => '#f2eef4', 'focus' => '#ff9ccb', 'current' => '#fff', ) ); } );
This seems to work in my testing. But I think this should be another ticket.
@fushar commented on PR #13806:
11 days ago
#93
I considered inline styles as well during my exploration. I think that's the most future-proof solution, considering that wp_admin_css_color proposal, however, it will add uncacheable inline CSS to every logged-in frontend request. I wonder if that's acceptable performance-wise?
@wildworks commented on PR #13806:
11 days ago
#94
it will add uncacheable inline CSS to every logged-in frontend request. I wonder if that's acceptable performance-wise?
We might actually need to benchmark and compare these approaches. My guess is that the performance impact will be negligible. For reference, wp_maybe_inline_styles uses a similar approach to inject CSS inline.
@wildworks commented on PR #13806:
9 days ago
#95
There doesn't seem to be much difference, even though this report was generated by AI.
---
Setup
- Local
wordpress-developenvironment (nginx, HTTP/1.1), front page, logged in as admin,moderncolor scheme. - Both variants use
admin-bar.min.css(4,025 bytes). - A temporary mu-plugin switches between the variants with
?ab=fileand?ab=inline. The inline variant setspathdata, sowp_maybe_inline_styles()inlines the stylesheet. The test checks that each variant outputs only<link>or only<style>. - Playwright (Chromium) with CDP throttling: Slow 4G (150ms latency, 1.6 Mbps down, 750 kbps up) and 4x CPU slowdown.
- 30 runs per variant per theme. File and inline runs alternate, and their order is swapped on every iteration.
- Cold: new browser context, empty cache. Warm: second load in the same context, so the browser cache is populated.
<details>
<summary>mu-plugin used for the A/B switch</summary>
<?php add_action( 'admin_bar_init', static function () { $styles = wp_styles(); if ( ! isset( $styles->registered['admin-bar-color-scheme'], $_GET['ab'] ) ) { return; } $style = $styles->registered['admin-bar-color-scheme']; $style->src = str_replace( 'admin-bar.css', 'admin-bar.min.css', $style->src ); if ( 'inline' === $_GET['ab'] ) { $rel = substr( $style->src, strlen( admin_url() ) ); wp_style_add_data( 'admin-bar-color-scheme', 'path', ABSPATH . 'wp-admin/' . $rel ); } }, 11 );
</details>
Results
Median ± median absolute deviation (ms). Diff = inline − file.
| Theme | Cache | Metric | File | Inline | Diff |
|---|---|---|---|---|---|
| Twenty Twenty-Five | Cold | FCP | 1470 ± 6 | 1440 ± 8 | −30 |
| Twenty Twenty-Five | Cold | LCP | 1544 ± 4 | 1512 ± 4 | −32 |
| Twenty Twenty-Five | Warm | FCP | 424 ± 4 | 428 ± 2 | +4 |
| Twenty Twenty-Five | Warm | LCP | 472 ± 4 | 492 ± 4 | +20 |
| Twenty Twenty-One | Cold | FCP | 1924 ± 8 | 1914 ± 10 | −10 |
| Twenty Twenty-One | Cold | LCP | 1924 ± 8 | 1914 ± 10 | −10 |
| Twenty Twenty-One | Warm | FCP | 416 ± 8 | 396 ± 4 | −20 |
| Twenty Twenty-One | Warm | LCP | 444 ± 8 | 460 ± 16 | +16 |
With inlining, the HTML grows by about 4 KB on every page view (uncompressed in this local environment).
Takeaways
- Cold cache: inline is 10–35ms faster (about 1–2%) because it removes one render-blocking request. This is larger than the run-to-run noise.
- Warm cache: the differences are mixed in sign and about the same size as the noise, so neither variant is clearly faster. The file variant benefits from the browser cache, and the inline variant re-sends the CSS with every page. Both effects are small.
Caveats
- The local environment uses HTTP/1.1 and may not compress responses. In production, with HTTP/2 and gzip/brotli, both the cost of the extra request and the extra inline bytes (about 1 KB compressed) are likely smaller, so the gap should shrink.
- CDP throttling does not fully reproduce real network round-trip times.
- Only Chromium was measured.
@fushar commented on PR #13806:
9 days ago
#96
Thanks for the test @t-hamano, I'm contemplating and brainstorming another solution that combines both approaches. Give me a few hours...
@fushar commented on PR #13806:
9 days ago
#97
All right, I have this other approach here: https://github.com/WordPress/wordpress-develop/pull/14011 which inlines CSS variables instead. My vision is to make the solution future-proof with https://core.trac.wordpress.org/ticket/65776 and align with the current "WPDS-fication" of classic PHP admin screens. I asked a question for @aduth in that ticket. If we want to make wp_admin_css_color() the source of truth for the seeds/colors, then I don't see any better approach. I'm happy to be wrong though!
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)



The front end intentionally did not use colors from the administration color scheme, and the
$_wp_admin_css_colorsvariable is not available. See #26021 and #43742.That is awkward now, after the default scheme changed within the admin area, but it was a decision.
If it is worth editing only for the Modern scheme,
WP_Admin_Bar::initialize()theoretically could have something like this between enqueuing theadmin-barstyle anddo_action( 'admin_bar_init' );.if ( ! is_admin() ) { global $wp_version; $user_color = get_user_option( 'admin_color' ); if ( isset( $user_color ) && 'modern' === $user_color ) { $suffix = is_rtl() ? '-rtl' : ''; $suffix .= SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_style( 'admin-bar-admin-color', admin_url( "css/colors/modern/colors$suffix.css" ), array(), $wp_version ); } }(I'm not sure whether it should check whether the user is logged in or any other conditions.)