Make WordPress Core

Opened 4 weeks ago

Closed 3 weeks ago

#64640 closed defect (bug) (fixed)

Upgrade screen shows invisible button

Reported by: fabiankaegy's profile fabiankaegy Owned by: joedolson's profile joedolson
Milestone: 7.0 Priority: normal
Severity: normal Version: trunk
Component: Administration Keywords: has-patch has-screenshots commit
Focuses: ui, accessibility, css Cc:

Description

After https://core.trac.wordpress.org/changeset/61645 was merged I am seeing a defect where the upgrade screen doesn't load the needed admin css variables from the base-styles stylesheet which leads to the button rendering without any background color and therefore appearing invisible

Attachments (1)

CleanShot 2026-02-15 at 09.36.32@2x.png (99.3 KB) - added by fabiankaegy 4 weeks ago.

Download all attachments as: .zip

Change History (28)

This ticket was mentioned in PR #10934 on WordPress/wordpress-develop by @fabiankaegy.


4 weeks ago
#1

  • Keywords has-patch added

Add fallback values for CSS custom properties so
buttons render correctly when wp-base-styles is not loaded, such as on the upgrade.php screen.

Trac ticket: https://core.trac.wordpress.org/ticket/64640

## Use of AI Tools

#2 @peterwilsoncc
4 weeks ago

As noted in my comment on the PR, I've noticed checkboxes are also affected. The Remember Me checkbox does not indicated the status of the checkbox on the login screen.

@wildworks commented on PR #10934:


4 weeks ago
#3

There is also a way to output fallback default CSS variables as shown below, but what do you think?

First, add the default CSS variables to the build styles in the @wordpress/base-styles package by making the following changes in the Gutenberg Github repo:

  • packages/base-styles/src/admin-schemes.scss

    diff --git a/packages/base-styles/src/admin-schemes.scss b/packages/base-styles/src/admin-schemes.scss
    index 9ae678fd7bf..3e9c1bf2778 100644
    a b  
    11@use "mixins" as *;
     2@use "default-custom-properties.scss" as *;
    23
    34@include wordpress-admin-schemes();

Next, in WP core, add wp-base-styles as a dependency to the login and error pages, and also fix the checkbox on the login screen.

  • src/wp-admin/css/login.css

    diff --git a/src/wp-admin/css/login.css b/src/wp-admin/css/login.css
    index 97c3f7e07a..6f90693447 100644
    a b p { 
    358358       padding-right: 2.5rem;
    359359}
    360360
    361 .login form .input,
    362 .login input[type="text"],
    363 .login form input[type="checkbox"] {
    364        background: #fff;
    365 }
    366 
    367361.js.login-action-resetpass input[type="text"],
    368362.js.login-action-resetpass input[type="password"],
    369363.js.login-action-rp input[type="text"],
  • src/wp-includes/script-loader.php

    diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
    index 4384c7c10e..1b9a9703ff 100644
    a b function wp_default_styles( $styles ) { 
    16331633
    16341634       $styles->add( 'wp-admin', false, array( 'dashicons', 'common', 'forms', 'admin-menu', 'dashboard', 'list-tables', 'edit', 'revisions', 'media', 'themes', 'about', 'nav-menus', 'widgets', 'site-icon', 'l10n', 'wp-base-styles' ) );
    16351635
    1636        $styles->add( 'login', "/wp-admin/css/login$suffix.css", array( 'dashicons', 'buttons', 'forms', 'l10n' ) );
    1637        $styles->add( 'install', "/wp-admin/css/install$suffix.css", array( 'dashicons', 'buttons', 'forms', 'l10n' ) );
     1636       $styles->add( 'login', "/wp-admin/css/login$suffix.css", array( 'dashicons', 'buttons', 'forms', 'l10n', 'wp-base-styles' ) );
     1637       $styles->add( 'install', "/wp-admin/css/install$suffix.css", array( 'dashicons', 'buttons', 'forms', 'l10n', 'wp-base-styles' ) );
    16381638       $styles->add( 'wp-color-picker', "/wp-admin/css/color-picker$suffix.css" );
    16391639       $styles->add( 'customize-controls', "/wp-admin/css/customize-controls$suffix.css", array( 'wp-admin', 'colors', 'imgareaselect' ) );
    16401640       $styles->add( 'customize-widgets', "/wp-admin/css/customize-widgets$suffix.css", array( 'wp-admin', 'colors' ) );

@peterwilsoncc commented on PR #10934:


4 weeks ago
#4

@t-hamano That was similar to the approach I took before seeing this PR: I was looking at changing the selector in this block of code to body.wp-core-ui, body.admin-color-modern and moving it to the top of the mixin to allow for body.admin-color-light to still work.

https://github.com/WordPress/gutenberg/blob/e755db0fb38e3d349cdd05a1c37661183e19ba72/packages/base-styles/_mixins.scss#L524-L526

I'm happy with either approach.

#5 @sabernhardt
4 weeks ago

#64650 was marked as a duplicate.

This ticket was mentioned in PR #10948 on WordPress/wordpress-develop by @peterwilsoncc.


4 weeks ago
#6

Alternative approach to https://github.com/WordPress/wordpress-develop/pull/10934

This adds the base styles as dependencies to the login and install stylesheets.

For non-admin admin screens:

  • the default theme's body class is added for screens that do not require a login
  • the user's selected theme's body class is added for screens that do require a login

When determining additional locations that required the theme's body class, I did a search for the string wp-core-ui.

Trac ticket:

## Use of AI Tools

Nil.

#7 @peterwilsoncc
4 weeks ago

I've created PR#10948 as an alternative approach based on @wildworks' comment. I think it will be less of a maintenance burden but am happy to hear from people who disagree.

@peterwilsoncc commented on PR #10934:


4 weeks ago
#8

I've attempted the approach suggested by @t-hamano in https://github.com/WordPress/wordpress-develop/pull/10948 -- a subjective opinion of the benefits is included in the PR description.

@fabiankaegy commented on PR #10948:


4 weeks ago
#9

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 👍

@audrasjb commented on PR #10948:


4 weeks ago
#10

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.

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.

@wildworks commented on PR #10934:


4 weeks ago
#11

I like the approach taken in #10948. It also doesn't require updating the base-styles package. It might be better to close this PR and move forward with #10948.

#13 @Presskopp
4 weeks ago

#64655 was marked as a duplicate.

@westonruter commented on PR #10948:


4 weeks ago
#14

The notices shown on wp-login.php seems like they aren't styled with the right color yet:

Login screen:

https://github.com/user-attachments/assets/ae4ec0b2-4b61-4ac4-9ffc-2822ef255efe

Password reset:

https://github.com/user-attachments/assets/0ad9dc6a-bf64-449f-b301-80c7a97eba6c

The upgrade screen looks right, but as with the login screen, the WP logo seems it will need to have its hue shifted to match.

https://github.com/user-attachments/assets/b43e7571-19ac-4516-abf2-daf0a072c8bd

@peterwilsoncc commented on PR #10948:


4 weeks ago
#15

@westonruter Noices were updated in another ticket, I've reopened to investigate in a separate PR, see Core-64548 (comment)

@peterwilsoncc commented on PR #10948:


4 weeks ago
#16

This 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.

Rego screen Rego success lost pw lost pw success lpw error
https://github.com/user-attachments/assets/40365684-1458-4b15-aafc-69cfd6fdcf3a https://github.com/user-attachments/assets/22b15843-fc4a-4a41-8ae7-c58a01601abf https://github.com/user-attachments/assets/f5ebf084-09ba-4346-88db-3c8fa2e79c0a https://github.com/user-attachments/assets/e8174753-0f84-4e3a-9910-90be57d8f20c https://github.com/user-attachments/assets/68f33f98-b0fc-4d95-82d7-c330ec55f278

@westonruter commented on PR #10948:


4 weeks ago
#17

ada4dae fixes the notices on the login screen

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.

@peterwilsoncc commented on PR #10948:


4 weeks ago
#18

There was no background with the test notices I threw in the dashboard so I think it's intended.

https://github.com/user-attachments/assets/68f57c23-b056-4f8a-a844-432b8422bbcc

@westonruter commented on PR #10948:


4 weeks ago
#19

I selected the Sunrise color scheme and I see these screens:

Repair | DB Upgrade | Login | wp_iframe()

--

https://github.com/user-attachments/assets/b4536d73-c1a7-4773-8363-e37302610ace | https://github.com/user-attachments/assets/2e2c57e1-923b-4595-abea-aa2906f53a37 | https://github.com/user-attachments/assets/ad283cd3-39ab-45fe-9f8d-3e351d07f815 | https://github.com/user-attachments/assets/9878ca41-2f4c-48ff-9c91-8afa3cd3d6a5

Only in the wp_iframe() is the color scheme shown, which I believe is as expected. It shows the expected scheme when I switch back to the default:

https://github.com/user-attachments/assets/65ca5677-fa76-47b9-81df-eeb137a6e3a5

<details><summary>Plugin Code to test <code>wp_iframe()</code></summary>

Navigating to /wp-admin/admin-ajax.php?action=my_iframe_content:

{{{php
<?php

add_action( 'wp_ajax_my_iframe_content', function () {

wp_iframe('my_iframe_content');
exit;

} );

function my_iframe_content() {

echo '<div style="margin:20px;">';
echo '<h1>Hello from inside the iframe!</h1>';
echo '<button class="button button-primary">test</button>';
echo '</div>';

}

}}}

</details>

@westonruter commented on PR #10948:


4 weeks ago
#20

Here's a diff of the HTML for the login page before and after this change:

  • .html

    old new  
    1212<link rel='stylesheet' id='buttons-css' href='http://localhost:8000/wp-includes/css/buttons.css?ver=7.0-alpha-61215-src' media='all' />
    1313<link rel='stylesheet' id='forms-css' href='http://localhost:8000/wp-admin/css/forms.css?ver=7.0-alpha-61215-src' media='all' />
    1414<link rel='stylesheet' id='l10n-css' href='http://localhost:8000/wp-admin/css/l10n.css?ver=7.0-alpha-61215-src' media='all' />
     15<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' />
    1516<link rel='stylesheet' id='login-css' href='http://localhost:8000/wp-admin/css/login.css?ver=7.0-alpha-61215-src' media='all' />
    1617        <meta name='referrer' content='strict-origin-when-cross-origin' />
    1718                <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    1819                </head>
    19         <body class="login no-js login-action-login wp-core-ui locale-en-us">
     20        <body class="login no-js login-action-login wp-core-ui admin-color-modern locale-en-us">
    2021        <script>
    2122document.body.className = document.body.className.replace('no-js','js');
    2223</script>

@huzaifaalmesbah commented on PR #10948:


4 weeks ago
#21

Visually looks good and working as expected 👍

DB Repair DB Upgrade Login with Checked Remember Me Reset Password Register
https://github.com/user-attachments/assets/14e8038e-662b-4bdb-8692-d3a1f4ce3dd9 https://github.com/user-attachments/assets/dce1ec23-8cdc-4add-9c63-36d962fde131 https://github.com/user-attachments/assets/c7d8b5dd-ae62-4ee8-9543-8adf85a4201f https://github.com/user-attachments/assets/144c0dcf-ef32-493d-9c9a-947d5fdbce09 https://github.com/user-attachments/assets/01cb6d34-0d95-4af0-88e0-4a5200c24466

@fabiankaegy commented on PR #10948:


4 weeks ago
#22

Thank you all for your help in getting this fixed ❤️

#23 @fabiankaegy
4 weeks ago

#64668 was marked as a duplicate.

#24 @SirLouen
4 weeks ago

Ok, I was searching for update not upgrade in #64668 🤦‍♂️
Good to see this has been already caught before beta.

jrchamp commented on PR #10948:


4 weeks ago
#25

Confirmed that this also fixes the install page checkbox:
https://github.com/user-attachments/assets/ee86db10-54ae-4cfc-ae03-96ff6382ee24

#26 @joedolson
3 weeks ago

  • Keywords has-screenshots commit added

#27 @joedolson
3 weeks ago

  • Owner set to joedolson
  • Resolution set to fixed
  • Status changed from assigned to closed

In 61681:

Admin: Apply scheme styles in non-admin admin screens.

Adds the admin-scheme styles as a dependency for the login and install styles. This is to ensure the CSS variables are available to the login, installation, database repair and upgrade screens.

Modifies the display of notices in the login styles to match those in the new default scheme, "modern".

Props peterwilsoncc, wildworks, westonruter, mukesh27, fabiankaegy, audrasjb, huzaifaalmesbah, sabernhardt, presskopp, SirLouen, ellatrix, nendeb55, neo2k23, jsmansart, joedolson.
Fixes #64640, #64548. See #64308.

Note: See TracTickets for help on using tickets.