Skip to content

Commit 0b87a0f

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@61681 602fd350-edb4-49c9-b593-d223f7449a82
1 parent b63a84b commit 0b87a0f

9 files changed

Lines changed: 30 additions & 24 deletions

File tree

src/wp-admin/css/login.css

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ body {
1515
}
1616

1717
a {
18-
color: #2271b1;
18+
color: var(--wp-admin-theme-color-darker-10);
1919
transition-property: border, background, color;
2020
transition-duration: .05s;
2121
transition-timing-function: ease-in-out;
@@ -27,7 +27,7 @@ a {
2727

2828
a:hover,
2929
a:active {
30-
color: #135e96;
30+
color: var(--wp-admin-theme-color-darker-20);
3131
}
3232

3333
a:focus {
@@ -44,22 +44,32 @@ p {
4444
.login .message,
4545
.login .notice,
4646
.login .success {
47-
border-left: 4px solid #72aee6;
48-
padding: 12px;
47+
border-left: 4px solid #3858e9;
48+
padding: 8px 12px;
49+
margin-top: 0;
4950
margin-left: 0;
5051
margin-bottom: 20px;
51-
background-color: #fff;
52-
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
52+
background-color: transparent;
5353
word-wrap: break-word;
5454
}
5555

56+
.login .message p,
57+
.login .notice p,
58+
.login .success p {
59+
font-size: 13px;
60+
line-height: 1.54;
61+
margin: 0.5em 0;
62+
}
63+
5664
.login .success {
57-
border-left-color: #00a32a;
65+
border-left-color: #4ab866;
66+
background-color: #eff9f1;
5867
}
5968

6069
/* Match border color from common.css */
6170
.login .notice-error {
62-
border-left-color: #d63638;
71+
border-left-color: #cc1818;
72+
background-color: #fcf0f0;
6373
}
6474

6575
.login .login-error-list {
@@ -113,8 +123,8 @@ p {
113123

114124
.login .button.wp-hide-pw:focus {
115125
background: transparent;
116-
border-color: #3582c4;
117-
box-shadow: 0 0 0 1px #3582c4;
126+
border-color: var(--wp-admin-theme-color);
127+
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
118128
/* Only visible in Windows High Contrast mode */
119129
outline: 2px solid transparent;
120130
}
@@ -360,12 +370,6 @@ p {
360370
padding-right: 2.5rem;
361371
}
362372

363-
.login form .input,
364-
.login input[type="text"],
365-
.login form input[type="checkbox"] {
366-
background: #fff;
367-
}
368-
369373
.js.login-action-resetpass input[type="text"],
370374
.js.login-action-resetpass input[type="password"],
371375
.js.login-action-rp input[type="text"],

src/wp-admin/includes/media.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ function wp_iframe( $content_func, ...$args ) {
611611

612612
?>
613613
</head>
614-
<body<?php echo $body_id_attr; ?> class="wp-core-ui no-js">
614+
<body<?php echo $body_id_attr; ?> class="wp-core-ui no-js <?php echo 'admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'modern' ); ?>">
615615
<script>
616616
document.body.className = document.body.className.replace('no-js', 'js');
617617
</script>

src/wp-admin/includes/template.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,6 +2172,7 @@ function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_r
21722172
do_action( 'admin_head' );
21732173

21742174
$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
2175+
$admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'modern' );
21752176

21762177
if ( is_rtl() ) {
21772178
$admin_body_class .= ' rtl';

src/wp-admin/install.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
1616
<title>Error: PHP is not running</title>
1717
</head>
18-
<body class="wp-core-ui">
18+
<body class="wp-core-ui admin-color-modern">
1919
<h1>Error: PHP is not running</h1>
2020
<p>WordPress requires that your web server is running PHP. Your server does not have PHP installed, or PHP is turned off.</p>
2121
</body>
@@ -72,7 +72,7 @@ function display_header( $body_classes = '' ) {
7272
<title><?php _e( 'WordPress &rsaquo; Installation' ); ?></title>
7373
<?php wp_admin_css( 'install', true ); ?>
7474
</head>
75-
<body class="wp-core-ui<?php echo $body_classes; ?>">
75+
<body class="wp-core-ui admin-color-modern<?php echo $body_classes; ?>">
7676
<p id="logo"><?php _e( 'WordPress' ); ?></p>
7777

7878
<?php

src/wp-admin/maint/repair.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<title><?php _e( 'WordPress &rsaquo; Database Repair' ); ?></title>
2121
<?php wp_admin_css( 'install', true ); ?>
2222
</head>
23-
<body class="wp-core-ui">
23+
<body class="wp-core-ui admin-color-modern">
2424
<p id="logo"><?php _e( 'WordPress' ); ?></p>
2525

2626
<?php

src/wp-admin/setup-config.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
function setup_config_display_header( $body_classes = array() ) {
9595
$body_classes = (array) $body_classes;
9696
$body_classes[] = 'wp-core-ui';
97+
$body_classes[] = 'admin-color-modern';
9798
$dir_attr = '';
9899
if ( is_rtl() ) {
99100
$body_classes[] = 'rtl';

src/wp-admin/upgrade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
<title><?php _e( 'WordPress &rsaquo; Update' ); ?></title>
8181
<?php wp_admin_css( 'install', true ); ?>
8282
</head>
83-
<body class="wp-core-ui">
83+
<body class="wp-core-ui admin-color-modern">
8484
<p id="logo"><?php _e( 'WordPress' ); ?></p>
8585

8686
<?php if ( (int) get_option( 'db_version' ) === $wp_db_version || ! is_blog_installed() ) : ?>

src/wp-includes/script-loader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,8 +1633,8 @@ 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' ) );

src/wp-login.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function login_header( $title = null, $message = '', $wp_error = null ) {
166166
*/
167167
$login_header_text = apply_filters( 'login_headertext', $login_header_text );
168168

169-
$classes = array( 'login-action-' . $action, 'wp-core-ui' );
169+
$classes = array( 'login-action-' . $action, 'wp-core-ui', 'admin-color-modern' );
170170

171171
if ( is_rtl() ) {
172172
$classes[] = 'rtl';

0 commit comments

Comments
 (0)