Opened 4 weeks ago
Closed 3 weeks ago
#64640 closed defect (bug) (fixed)
Upgrade screen shows invisible button
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| 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)
Change History (28)
This ticket was mentioned in PR #10934 on WordPress/wordpress-develop by @fabiankaegy.
4 weeks ago
#1
- Keywords has-patch added
#2
@
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 1 1 @use "mixins" as *; 2 @use "default-custom-properties.scss" as *; 2 3 3 4 @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 { 358 358 padding-right: 2.5rem; 359 359 } 360 360 361 .login form .input,362 .login input[type="text"],363 .login form input[type="checkbox"] {364 background: #fff;365 }366 367 361 .js.login-action-resetpass input[type="text"], 368 362 .js.login-action-resetpass input[type="password"], 369 363 .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 ) { 1633 1633 1634 1634 $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' ) ); 1635 1635 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' ) ); 1638 1638 $styles->add( 'wp-color-picker', "/wp-admin/css/color-picker$suffix.css" ); 1639 1639 $styles->add( 'customize-controls', "/wp-admin/css/customize-controls$suffix.css", array( 'wp-admin', 'colors', 'imgareaselect' ) ); 1640 1640 $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.
I'm happy with either approach.
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
@
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
@fabiankaegy commented on PR #10934:
4 weeks ago
#12
Closing in favor of https://github.com/WordPress/wordpress-develop/pull/10948
@westonruter commented on PR #10948:
4 weeks ago
#14
@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
@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
@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()
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:
<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 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' /> 13 13 <link rel='stylesheet' id='forms-css' href='http://localhost:8000/wp-admin/css/forms.css?ver=7.0-alpha-61215-src' media='all' /> 14 14 <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' /> 15 16 <link rel='stylesheet' id='login-css' href='http://localhost:8000/wp-admin/css/login.css?ver=7.0-alpha-61215-src' media='all' /> 16 17 <meta name='referrer' content='strict-origin-when-cross-origin' /> 17 18 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 18 19 </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"> 20 21 <script> 21 22 document.body.className = document.body.className.replace('no-js','js'); 22 23 </script>
@huzaifaalmesbah commented on PR #10948:
4 weeks ago
#21
@fabiankaegy commented on PR #10948:
4 weeks ago
#22
Thank you all for your help in getting this fixed ❤️
#24
@
4 weeks ago
Ok, I was searching for update not upgrade in #64668 🤦♂️
Good to see this has been already caught before beta.
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