Include base styles for additional admin screens#10948
Include base styles for additional admin screens#10948peterwilsoncc wants to merge 4 commits intoWordPress:trunkfrom
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. |
There was a problem hiding this comment.
Pull request overview
This PR aims to ensure core “base styles” are present on additional non-admin admin screens (notably login and install/upgrade/repair flows) so UI components like buttons render consistently outside the main admin.
Changes:
- Adds
wp-base-stylesas a dependency for theloginandinstallstylesheets. - Adds an
admin-color-*body class to several non-admin admin screens that outputwp-core-ui. - Removes a now-redundant login input background rule, relying on the base styles instead.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/wp-login.php |
Adds admin-color-modern to login body classes. |
src/wp-includes/script-loader.php |
Makes login/install styles depend on wp-base-styles. |
src/wp-admin/upgrade.php |
Adds admin-color-modern to the upgrade screen body class. |
src/wp-admin/setup-config.php |
Adds admin-color-modern to setup-config body classes. |
src/wp-admin/maint/repair.php |
Adds admin-color-modern to the DB repair screen body class. |
src/wp-admin/install.php |
Adds admin-color-modern to installer body classes. |
src/wp-admin/includes/template.php |
Adds user-derived admin-color-* class to Thickbox iframe body class construction. |
src/wp-admin/includes/media.php |
Adds user-derived admin-color-* class to legacy media upload iframe body class. |
src/wp-admin/css/login.css |
Removes explicit white background styling for certain login inputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
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. |
|
Thank you for this! :) I originally started with loading the base styles but then failed at the step of adding the default themes admin scheme class to the screens and was concerned that there might be additional screens I wasn't aware of. Which is why I then went with the other approach. But I agree it isn't ideal. So this here feels better to me 👍 |
I wasn't fond of loading all these resources on such a screen, but this is the main reason why I do think this would be the best approach to fix this issue. |
4419839 to
9aac6d6
Compare
|
@westonruter Noices were updated in another ticket, I've reopened to investigate in a separate PR, see Core-64548 (comment) |
|
ada4dae fixes the notices on the login screen @westonruter highlights above, cc @joedolson @fabiankaegy I was going to try and fix the login notices in another PR but realised I needed the base styles.
|
| @@ -15,7 +15,7 @@ body { | |||
| } | |||
|
|
|||
| a { | |||
There was a problem hiding this comment.
These will need validation that there aren't any side-effects. The color of the back to site and lost password links in the footer of the screen are coded with a higher specificity so I think they will be fine.
That still doesn't look quite right, as there is no background color for the notice? Maybe that's how it is supposed to be, but it feels off given how I'm used to seeing the notices. Although there is a background color for the error notice. Shouldn't there be something for the info notice? |
westonruter
left a comment
There was a problem hiding this comment.
LGTM, bit I defer to others who are more familiar with styling the admin.
|
Here's a diff of the HTML for the login page before and after this change: --- before.html 2026-02-17 18:09:58
+++ after.html 2026-02-17 18:10:24
@@ -12,11 +12,12 @@
<link rel='stylesheet' id='buttons-css' href='http://localhost:8000/wp-includes/css/buttons.css?ver=7.0-alpha-61215-src' media='all' />
<link rel='stylesheet' id='forms-css' href='http://localhost:8000/wp-admin/css/forms.css?ver=7.0-alpha-61215-src' media='all' />
<link rel='stylesheet' id='l10n-css' href='http://localhost:8000/wp-admin/css/l10n.css?ver=7.0-alpha-61215-src' media='all' />
+<link rel='stylesheet' id='wp-base-styles-css' href='http://localhost:8000/wp-includes/css/dist/base-styles/admin-schemes.css?ver=7.0-alpha-61215-src' media='all' />
<link rel='stylesheet' id='login-css' href='http://localhost:8000/wp-admin/css/login.css?ver=7.0-alpha-61215-src' media='all' />
<meta name='referrer' content='strict-origin-when-cross-origin' />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
- <body class="login no-js login-action-login wp-core-ui locale-en-us">
+ <body class="login no-js login-action-login wp-core-ui admin-color-modern locale-en-us">
<script>
document.body.className = document.body.className.replace('no-js','js');
</script>
|



















Alternative approach to #10934
This adds the base styles as dependencies to the login and install stylesheets.
For non-admin admin screens:
When determining additional locations that required the theme's body class, I did a search for the string
wp-core-ui.Trac ticket: https://core.trac.wordpress.org/ticket/64640
Trac ticket: https://core.trac.wordpress.org/ticket/64548
Review requests:
get_user_option()for all logged in screensget_user_option()where it is unavailable (if that's a thing)wp-core-uifor instances I've missed, added unnecessarily.Test the DB repair screen
define( 'WP_ALLOW_REPAIR', true );/wp-admin/maint/repair.phpTest the DB upgrade screen
version.phpbump the DB version to a higher number/wp-adminTest the login screen
I think that's it.
Benefits of this approach
This is a very subjective view, reviewers please let me know if you disagree!
I think this is less of a maintenance burden than using css variable fallbacks. While the fallbacks will work, every time a CSS variable in the base styles is tweaked in the default theme, the developer will lead to remember to modify the occurrences in the CSS variable fallbacks.
By applying the base styles to the non-logged in screens, devs can be sure tweaking the default styles will update in all the locations.
Use of AI Tools
Nill for coding, initial code review.
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.