Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 44 additions & 21 deletions src/wp-admin/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -1499,13 +1499,25 @@ th.action-links {
4.0 - Notifications
------------------------------------------------------------------------------*/

/*
* Tone is carried by the surface, a full hairline border and the text colour.
* Padding, paragraph margins and the dismiss button's position are unchanged:
* plugins position their own elements against the inside of this box, so only
* its paint may change here.
*
* Paint comes from design system tokens, so a notice follows the theme the
* tokens resolve to. Geometry stays in literal values for the same reason the
* box may not move. The tokens are defined by the wp-theme stylesheet, which
* this one depends on, so no var() fallbacks are needed.
*/
.notice,
div.updated,
div.error {
background: #fff;
border: none;
border-left: 4px solid #c3c4c7;
background: var(--wpds-color-background-surface-neutral-weak);
border: var(--wpds-border-width-xs) solid var(--wpds-color-stroke-surface-neutral);
border-radius: var(--wpds-border-radius-lg);
box-shadow: none;
color: var(--wpds-color-foreground-content-neutral);
margin: 5px 15px 2px;
padding: 8px 12px;
}
Expand All @@ -1523,7 +1535,7 @@ div.error p,
padding: 0;
font-size: 13px;
line-height: 1.54;
color: #1e1e1e;
color: inherit;
}

div.notice a,
Expand Down Expand Up @@ -1557,7 +1569,7 @@ div.updated a:focus {

.notice-title {
display: inline-block;
color: #1d2327;
color: inherit;
font-size: 18px;
}

Expand All @@ -1574,19 +1586,26 @@ div.updated a:focus {
margin: 0;
padding: 0;
background: none;
color: #1e1e1e;
/* Takes the notice's tone. */
color: inherit;
cursor: pointer;
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 2px;
/* A compact control inside the notice, so it takes the small radius rather than the notice's own container radius. */
border-radius: var(--wpds-border-radius-sm);
}

/* The glyph follows the button, so a plugin that colours the button colours the icon. */
.notice-dismiss::before {
color: inherit;
}

.notice-dismiss:hover::before,
.notice-dismiss:active::before {
color: #1e1e1e;
color: inherit;
opacity: 0.7;
}

Expand All @@ -1597,47 +1616,51 @@ div.updated a:focus {
}

.notice-dismiss:focus::before {
color: #1e1e1e;
color: inherit;
}

.notice-success,
div.updated {
border-left-color: #4ab866;
background-color: #eff9f1;
border-color: var(--wpds-color-stroke-surface-success);
background-color: var(--wpds-color-background-surface-success-weak);
color: var(--wpds-color-foreground-content-success);
}

.notice-success.notice-alt,
div.updated.notice-alt {
background-color: #eff9f1;
background-color: var(--wpds-color-background-surface-success-weak);
}

.notice-warning {
border-left-color: #f0b849;
background-color: #fef8ee;
border-color: var(--wpds-color-stroke-surface-warning);
background-color: var(--wpds-color-background-surface-warning-weak);
color: var(--wpds-color-foreground-content-warning);
}

.notice-warning.notice-alt {
background-color: #fef8ee;
background-color: var(--wpds-color-background-surface-warning-weak);
}

.notice-error,
div.error {
border-left-color: #cc1818;
background-color: #fcf0f0;
border-color: var(--wpds-color-stroke-surface-error);
background-color: var(--wpds-color-background-surface-error-weak);
color: var(--wpds-color-foreground-content-error);
}

.notice-error.notice-alt,
div.error.notice-alt {
background-color: #fcf0f0;
background-color: var(--wpds-color-background-surface-error-weak);
}

.notice-info {
border-left-color: #3858e9;
background-color: #fff;
border-color: var(--wpds-color-stroke-surface-info);
background-color: var(--wpds-color-background-surface-info-weak);
color: var(--wpds-color-foreground-content-info);
}

.notice-info.notice-alt {
background-color: #fff;
background-color: var(--wpds-color-background-surface-info-weak);
}

#plugin-information-footer .update-now:not(.button-disabled)::before {
Expand Down
7 changes: 6 additions & 1 deletion src/wp-admin/css/customize-controls.css
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,8 @@ p.customize-section-description {
margin: 0 0 6px;
padding: 9px 14px;
overflow: hidden;
/* Notifications span the panel's full width, so they are bands rather than boxes. */
border-radius: 0;
}

#customize-controls .customize-control-notifications-container .notice.is-dismissible {
Expand Down Expand Up @@ -1269,6 +1271,8 @@ p.customize-section-description {
#customize-controls .panel-meta > .customize-control-notifications-container .notice,
#customize-controls .customize-section-title > .customize-control-notifications-container .notice {
padding: 9px 14px;
/* Stacked flush against the panel's edges and each other, so no corners. */
border-radius: 0;
}

#customize-controls #customize-notifications-area .notice.is-dismissible,
Expand Down Expand Up @@ -1296,7 +1300,8 @@ p.customize-section-description {
#customize-controls .notice.notification-overlay,
#customize-controls #customize-notifications-area .notice.notification-overlay {
margin: 0;
border-left: 0; /* @todo Appropriate styles could be added for notice-error, notice-warning, notice-success, etc */
border: 0; /* @todo Appropriate styles could be added for notice-error, notice-warning, notice-success, etc */
border-radius: 0;
}

#customize-controls .customize-control-notifications-container.has-overlay-notifications {
Expand Down
40 changes: 32 additions & 8 deletions src/wp-admin/css/login.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,23 @@ p {
line-height: 1.5;
}

/*
* The login screen renders its messages through wp_admin_notice(), so the markup
* is the admin's. It does not load common.css, so the notice paint is repeated
* here; both stylesheets read the same tokens, which is what keeps the two in
* agreement. Padding and margins are unchanged, so only the paint moves.
*/
.login .message,
.login .notice,
.login .success {
border-left: 4px solid #3858e9;
background: var(--wpds-color-background-surface-neutral-weak);
border: var(--wpds-border-width-xs) solid var(--wpds-color-stroke-surface-neutral);
border-radius: var(--wpds-border-radius-lg);
color: var(--wpds-color-foreground-content-neutral);
padding: 8px 12px;
margin-top: 0;
margin-left: 0;
margin-bottom: 20px;
background-color: #fff;
word-wrap: break-word;
}

Expand All @@ -59,15 +67,31 @@ p {
margin: 0.5em 0;
}

.login .success {
border-left-color: #4ab866;
background-color: #eff9f1;
/* An instructional message is rendered as an info notice, so it takes that tone. */
.login .message,
.login .notice-info {
border-color: var(--wpds-color-stroke-surface-info);
background-color: var(--wpds-color-background-surface-info-weak);
color: var(--wpds-color-foreground-content-info);
}

.login .success,
.login .notice-success {
border-color: var(--wpds-color-stroke-surface-success);
background-color: var(--wpds-color-background-surface-success-weak);
color: var(--wpds-color-foreground-content-success);
}

.login .notice-warning {
border-color: var(--wpds-color-stroke-surface-warning);
background-color: var(--wpds-color-background-surface-warning-weak);
color: var(--wpds-color-foreground-content-warning);
}

/* Match border color from common.css */
.login .notice-error {
border-left-color: #cc1818;
background-color: #fcf0f0;
border-color: var(--wpds-color-stroke-surface-error);
background-color: var(--wpds-color-background-surface-error-weak);
color: var(--wpds-color-foreground-content-error);
}

.login .login-error-list {
Expand Down
6 changes: 6 additions & 0 deletions src/wp-admin/css/themes.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ body.js .theme-browser.search-loading {
position: absolute;
right: 0;
top: 0;
/*
* The message is a band pinned to the card's edges, not a box of its own.
* The card already clips it to the card's own corner radius, so a radius
* here would only pull the band away from that corner.
*/
border-radius: 0;
}

/**
Expand Down
15 changes: 13 additions & 2 deletions src/wp-includes/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -1592,7 +1592,13 @@ function wp_default_styles( $styles ) {

// Admin CSS.
$styles->add( 'wp-tooltip', "/wp-admin/css/wp-tooltip$suffix.css", array( 'dashicons' ) );
$styles->add( 'common', "/wp-admin/css/common$suffix.css" );
/*
* The notice styles in common.css paint from design system tokens, which the
* wp-theme stylesheet defines. The dependency is declared per stylesheet rather
* than on the wp-admin bundle so that the tokens also load on screens that
* enqueue common.css on its own.
*/
$styles->add( 'common', "/wp-admin/css/common$suffix.css", array( 'wp-theme' ) );
$styles->add( 'forms', "/wp-admin/css/forms$suffix.css" );
$styles->add( 'admin-menu', "/wp-admin/css/admin-menu$suffix.css" );
$styles->add( 'dashboard', "/wp-admin/css/dashboard$suffix.css" );
Expand All @@ -1611,7 +1617,12 @@ function wp_default_styles( $styles ) {

$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', 'wp-tooltip' ) );

$styles->add( 'login', "/wp-admin/css/login$suffix.css", array( 'dashicons', 'buttons', 'forms', 'l10n', 'wp-base-styles', 'wp-tooltip' ) );
/*
* The login screen paints its messages from design system tokens, which the
* wp-theme stylesheet defines. It does not load common.css, so the dependency
* is declared here as well.
*/
$styles->add( 'login', "/wp-admin/css/login$suffix.css", array( 'wp-theme', 'dashicons', 'buttons', 'forms', 'l10n', 'wp-base-styles', 'wp-tooltip' ) );
$styles->add( 'install', "/wp-admin/css/install$suffix.css", array( 'dashicons', 'buttons', 'forms', 'l10n', 'wp-base-styles' ) );
$styles->add( 'wp-color-picker', "/wp-admin/css/color-picker$suffix.css" );
$styles->add( 'customize-controls', "/wp-admin/css/customize-controls$suffix.css", array( 'wp-admin', 'colors', 'imgareaselect' ) );
Expand Down
Loading