Repository navigation
Base Styles: Default the admin theme color to Blueberry - #83749
Conversation
commented
Sep 29, 2026
🤖 PR meta 🤖👋 Welcome👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @adamwoodnz! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
59b6f15 to
397fe16
Compare
91adc5c to
0d78972
Compare
There was a problem hiding this comment.
Can we also include the body.admin-color-fresh rule in this stylesheet (with a comment explaining why)?
The addition to wordpress-admin-schemes() preserves Fresh when both stylesheets update together, as they do when installing this Gutenberg PR. But plugins can compile default-custom-properties into their own CSS while relying on WordPress to supply the admin-scheme stylesheet. For example, EditorsKit imports these defaults in its Styles Manager styles, and WooCommerce imports them in its shared build styles.
If such a plugin rebuilds with the updated base-styles package, its CSS gets the Blueberry root default, but the installed WordPress version may still supply a scheme stylesheet without the new Fresh rule. Fresh previously inherited the old blue from :root, so it now inherits Blueberry instead. Plugins using only WordPress-provided styles would not have this mixed-version issue.
I reproduced that color change in an isolated browser check using the compiled defaults alongside WordPress 6.9 and 7.0's shipped CSS. Including body.admin-color-fresh { @include mixins.admin-scheme(#007cba); } here restored the original color.
Keeping the Fresh rule in both places would make the protection travel with independently bundled defaults, while standalone apps without the Fresh body class still get Blueberry.
I think this is necessary to keep this PR in "enhancement" territory and not a breaking change.
There was a problem hiding this comment.
Good catch, thanks. Added in 4873971: body.admin-color-fresh { @include mixins.admin-scheme(#007cba); } now follows the :root block in _default-custom-properties.scss, with a comment on why. The rule stays in wordpress-admin-schemes() too, and the changelog entry covers both.
Verified in wp-env with the Fresh scheme on the Dashboard. I removed the Fresh rule from wp-base-styles in the page to simulate an older WordPress admin-schemes.css. The primary button stays rgb(0, 124, 186), because the rule now also ships in the commands, block-editor, patterns, and editor stylesheets. When I also removed those copies, it turned rgb(56, 88, 233). The editor with Fresh is also #007cba.
There was a problem hiding this comment.
Also I'm unable to re-run the failing CI checks, which I believe are unrelated. Would you be able to do that for me please?
There was a problem hiding this comment.
Two separate CI issues were fixed on trunk, so I merged them in 👍
WordPress 7.0 made the Modern scheme the default admin color scheme, and @wordpress/components already defaults to #3858e9. The shared :root default still set the legacy #007cba, and every package that includes it overrides components' default wherever it loads later. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P6pdsb2opCsCz4AxKEoRfC
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P6pdsb2opCsCz4AxKEoRfC
wordpress-admin-schemes() had no rule for Fresh, so Fresh took the :root default. That matched Fresh's color only while the default was the legacy #007cba. With the new #3858e9 default, wp-admin screens without a ThemeProvider, such as the Dashboard, turned Fresh users' primary buttons blueberry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GZRTg2FAg6L9NZxXyNgdgy
These var() fallbacks still named the legacy #007cba while the base-styles default and @wordpress/components use #3858e9. Where the variable is undefined, they would show a different accent from the rest of the UI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GZRTg2FAg6L9NZxXyNgdgy
Plugins such as WooCommerce and EditorsKit compile the default custom properties into their own CSS, but WordPress supplies the scheme stylesheet. On a WordPress version whose admin-schemes.css has no Fresh rule, those plugins' new #3858e9 :root default would turn Fresh users' admin blueberry. Keeping the rule next to the defaults makes the protection travel with them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K3qk57gA8c1M2qj12mUtJx
4873971 to
ed9b271
Compare
What?
Closes #83748
Changes the
:rootdefault for--wp-admin-theme-colorin@wordpress/base-stylesfrom the legacy#007cbato#3858e9, the WordPress 7.0 default admin color scheme.Why?
WordPress 7.0 made the Modern scheme the default and moved existing users to it (Trac #64546, r61644).
@wordpress/componentsalready defaults to#3858e9(#50193). The shared:rootdefault in base-styles still sets#007cba, and most packages include it (block-library,block-editor,editor,edit-site, and others). Outside wp-admin (Storybook, standalone apps), whichever of those stylesheets loads aftercomponentsresets the accent to#007cba. Jetpack's Storybook currently works around this with its own override (Automattic/jetpack#52849).How?
_default-custom-properties.scss:admin-scheme(#007cba)becomesadmin-scheme(#3858e9)._mixins.scss: thelink-resetfocus fallback matches the new default._mixins.scss:wordpress-admin-schemes()gets abody.admin-color-freshrule with#007cba. Fresh had no rule and took the:rootdefault, so without this, wp-admin screens that have noThemeProvider(for example the Dashboard) would turn Fresh users' primary buttons blueberry. The value matchesadmin-ui's Fresh mapping (packages/admin-ui/src/admin-theme-colors/index.ts)._default-custom-properties.scss: the same Fresh rule follows the:rootblock. Plugins such as WooCommerce compile these defaults into their own CSS while the installed WordPress suppliesadmin-schemes.css, which on older versions has no Fresh rule. Shipping the rule with the defaults keeps Fresh on#007cbain that mixed-version case.var(--wp-admin-theme-color, #007cba)fallbacks inblock-editor(global styles inheritance),editor(Style Book), andmedia-editor(cropper) become#3858e9, so the fallback matches the default everywhere.The
lightscheme inwordpress-admin-schemes()keeps#007cba: that is the scheme's own color.Testing Instructions
npm run build.In
packages/block-library/build-style/common.css, the:rootrule sets--wp-admin-theme-color: #3858e9and--wp-admin-theme-color--rgb: 56, 88, 233.npm run storybook:dev(it starts its own watch build). Gutenberg's Storybook shows no visible change: itsWithDesignSystemThemedecorator sets--wp-admin-theme-colorinline on<html>, and that hides the stylesheet default. To see the default, open Editor / Block Editor / Inserter / Quick Inserter in the canvas iframe and run this in the console:This branch returns
#3858e9. Production Storybook (trunk) returns#007cba.npm run wp-env start(this repo's.wp-env.jsonmounts the checkout as the plugin), and log in athttp://localhost:8888/wp-adminwithadmin/password. In Users → Profile, check each scheme on the Dashboard (the "Publish" button in Quick Draft) and in the block editor (the "Publish" button):#3858e9#007cba, the same as trunk#567958Check Fresh on the Dashboard. The block editor sets the scheme color inline through
ThemeProvider, so the editor does not show a regression there.Verified on
48739714e3(rebased on05f1759ea6, afternpm ci):npm run build,npm run lint:css, andnpm run lint:jspass, andcommon.csshas the values in step 2. In wp-env, the Publish buttons on the Dashboard and in the editor are#3858e9for Modern,#007cbafor Fresh, and#567958for Ocean. For Fresh, I also removed the rule fromwp-base-stylesto simulate an older WordPressadmin-schemes.css: the Dashboard stays#007cba, and turns blueberry only when the package copies are removed too. Before the rebase, the Fresh Dashboard matched trunk (26338bff28, built and checked in the same environment), and the step 3 console check returned#3858e9locally and#007cbain production Storybook.Testing Instructions for Keyboard
N/A: no UI change beyond the default accent color.
Screenshots or screencast
N/A
Use of AI Tools
Authored with Claude Code (Claude Opus 5.5): source investigation, the change, and this description.