Skip to content

Commit e814c54

Browse files
committed
Admin UI: Reskin notices to align with WordPress Design System
Update all notice styles to match Gutenberg's component patterns and the WordPress Design System specifications. **Base Notice Styles:** - Border: 4px left border only (removed generic border) - Box shadow: removed for cleaner appearance - Padding: 8px 12px (was 1px 12px) - Typography: 13px/20px, color #1e1e1e (gray-900) **Notice Type Colors:** - Info: #3858e9 border, transparent background - Success: #4ab866 border, #eff9f1 background - Warning: #f0b849 border, #fef8ee background - Error: #cc1818 border, #fcf0f0 background **Dismiss Button:** - Size: 24px × 24px (was 20px × 20px) - Position: top 8px, right 12px (improved alignment) - Color: #1e1e1e (was #787c82) - Icon size: 20px/24px (was 16px/20px) - Focus: Gutenberg-style ring using var(--wp-admin-theme-color) - Hover: opacity 0.7 **Links in Notices:** - Color: var(--wp-admin-theme-color) - Hover: var(--wp-admin-theme-color-darker-10) - Focus: proper focus ring with var(--wp-admin-border-width-focus) **Spacing:** - Dismissible notices: 48px right padding (was 38px) - Provides 24px gap between content and dismiss button See: https://core.trac.wordpress.org/ticket/64308
1 parent 9e848a3 commit e814c54

File tree

1 file changed

+63
-31
lines changed

1 file changed

+63
-31
lines changed

src/wp-admin/css/common.css

Lines changed: 63 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -805,14 +805,14 @@ img.emoji {
805805
#bulk-titles .ntdelbutton:before,
806806
.notice-dismiss:before {
807807
background: none;
808-
color: #787c82;
808+
color: #1e1e1e;
809809
content: "\f153";
810810
content: "\f153" / '';
811811
display: block;
812-
font: normal 16px/20px dashicons;
813-
height: 20px;
812+
font: normal 20px/24px dashicons;
813+
height: 24px;
814814
text-align: center;
815-
width: 20px;
815+
width: 24px;
816816
-webkit-font-smoothing: antialiased;
817817
-moz-osx-font-smoothing: grayscale;
818818
}
@@ -1420,11 +1420,11 @@ th.action-links {
14201420
div.updated,
14211421
div.error {
14221422
background: #fff;
1423-
border: 1px solid #c3c4c7;
1424-
border-left-width: 4px;
1425-
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
1423+
border: none;
1424+
border-left: 4px solid #c3c4c7;
1425+
box-shadow: none;
14261426
margin: 5px 15px 2px;
1427-
padding: 1px 12px;
1427+
padding: 8px 12px;
14281428
}
14291429

14301430
div[class="update-message"] { /* back-compat for pre-4.6 */
@@ -1437,15 +1437,31 @@ div.updated p,
14371437
div.error p,
14381438
.form-table td .notice p {
14391439
margin: 0.5em 0;
1440-
padding: 2px;
1440+
padding: 0;
1441+
font-size: 13px;
1442+
line-height: 20px;
1443+
color: #1e1e1e;
14411444
}
14421445

1443-
.error a {
1446+
.notice a,
1447+
.error a,
1448+
.updated a {
1449+
color: var(--wp-admin-theme-color);
14441450
text-decoration: underline;
14451451
}
14461452

1447-
.updated a {
1448-
padding-bottom: 2px;
1453+
.notice a:hover,
1454+
.error a:hover,
1455+
.updated a:hover {
1456+
color: var(--wp-admin-theme-color-darker-10);
1457+
}
1458+
1459+
.notice a:focus,
1460+
.error a:focus,
1461+
.updated a:focus {
1462+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
1463+
outline: 2px solid transparent;
1464+
border-radius: 2px;
14491465
}
14501466

14511467
.notice-alt {
@@ -1463,66 +1479,82 @@ div.error p,
14631479
}
14641480

14651481
.wp-core-ui .notice.is-dismissible {
1466-
padding-right: 38px;
1482+
padding-right: 48px;
14671483
position: relative;
14681484
}
14691485

14701486
.notice-dismiss {
14711487
position: absolute;
1472-
top: 0;
1473-
right: 1px;
1488+
top: 8px;
1489+
right: 12px;
14741490
border: none;
14751491
margin: 0;
1476-
padding: 9px;
1492+
padding: 0;
14771493
background: none;
1478-
color: #787c82;
1494+
color: #1e1e1e;
14791495
cursor: pointer;
1496+
width: 24px;
1497+
height: 24px;
1498+
display: flex;
1499+
align-items: center;
1500+
justify-content: center;
1501+
border-radius: 2px;
14801502
}
14811503

14821504
.notice-dismiss:hover:before,
1483-
.notice-dismiss:active:before,
1484-
.notice-dismiss:focus:before {
1485-
color: #d63638;
1505+
.notice-dismiss:active:before {
1506+
color: #1e1e1e;
1507+
opacity: 0.7;
14861508
}
14871509

14881510
.notice-dismiss:focus {
1489-
box-shadow: 0 0 0 2px #2271b1;
1511+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
14901512
/* Only visible in Windows High Contrast mode */
14911513
outline: 2px solid transparent;
14921514
}
14931515

1516+
.notice-dismiss:focus:before {
1517+
color: #1e1e1e;
1518+
}
1519+
14941520
.notice-success,
14951521
div.updated {
1496-
border-left-color: #00a32a;
1522+
border-left-color: #4ab866;
1523+
background-color: #eff9f1;
14971524
}
14981525

1499-
.notice-success.notice-alt {
1500-
background-color: #edfaef;
1526+
.notice-success.notice-alt,
1527+
div.updated.notice-alt {
1528+
background-color: #eff9f1;
15011529
}
15021530

15031531
.notice-warning {
1504-
border-left-color: #dba617;
1532+
border-left-color: #f0b849;
1533+
background-color: #fef8ee;
15051534
}
15061535

15071536
.notice-warning.notice-alt {
1508-
background-color: #fcf9e8;
1537+
background-color: #fef8ee;
15091538
}
15101539

15111540
.notice-error,
15121541
div.error {
1513-
border-left-color: #d63638;
1542+
border-left-color: #cc1818;
1543+
background-color: #fcf0f0;
15141544
}
15151545

1516-
.notice-error.notice-alt {
1517-
background-color: #fcf0f1;
1546+
.notice-error.notice-alt,
1547+
div.error.notice-alt {
1548+
background-color: #fcf0f0;
15181549
}
15191550

15201551
.notice-info {
1521-
border-left-color: #72aee6;
1552+
border-left-color: #3858e9;
1553+
background-color: transparent;
15221554
}
15231555

15241556
.notice-info.notice-alt {
1525-
background-color: #f0f6fc;
1557+
background-color: transparent;
15261558
}
15271559

15281560
#plugin-information-footer .update-now:not(.button-disabled):before {

0 commit comments

Comments
 (0)