Make WordPress Core

Changeset 61647


Ignore:
Timestamp:
02/15/2026 08:23:56 AM (8 weeks ago)
Author:
fabiankaegy
Message:

Admin: Update notice styles to align with the design system.

Remove the full border and box-shadow from notices, keeping only the 4px left border. Add semantic background colors to each notice type: green for success, yellow for warnings, red for errors, and transparent for info. Update border colors to match the design system tokens.

Restyle the dismiss button with a larger 24px icon, flexbox centering, and 2px border-radius. Replace the red hover color with a subtle opacity change and apply a theme-color focus ring. Increase dismissible notice right padding to accommodate the larger button.

Update notice text with consistent typography and restyle notice links to use theme color custom properties with matching focus rings.

Props fabiankaegy, mukesh27, joedolson, phpbits, sabernhardt, Joen, fcoveram, dkotter, navi161, poojapadamad.
Fixes #64548.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/common.css

    r61646 r61647  
    789789
    790790.stuffbox .hndle {
    791     border-bottom: 1px solid rgb(0, 0, 0, 0.1);
     791    border-bottom: 1px solid #c3c4c7;
    792792}
    793793
     
    808808.notice-dismiss:before {
    809809    background: none;
    810     color: #787c82;
     810    color: #1e1e1e;
    811811    content: "\f153";
    812812    content: "\f153" / '';
    813813    display: block;
    814     font: normal 16px/20px dashicons;
    815     height: 20px;
     814    font: normal 20px/24px dashicons;
     815    height: 24px;
    816816    text-align: center;
    817     width: 20px;
     817    width: 24px;
    818818    -webkit-font-smoothing: antialiased;
    819819    -moz-osx-font-smoothing: grayscale;
     
    14451445div.error {
    14461446    background: #fff;
    1447     border: 1px solid #c3c4c7;
    1448     border-left-width: 4px;
    1449     box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
     1447    border: none;
     1448    border-left: 4px solid #c3c4c7;
     1449    box-shadow: none;
    14501450    margin: 5px 15px 2px;
    1451     padding: 1px 12px;
     1451    padding: 8px 12px;
    14521452}
    14531453
     
    14621462.form-table td .notice p {
    14631463    margin: 0.5em 0;
    1464     padding: 2px;
    1465 }
    1466 
    1467 .error a {
     1464    padding: 0;
     1465    font-size: 13px;
     1466    line-height: 1.54;
     1467    color: #1e1e1e;
     1468}
     1469
     1470.notice a,
     1471.error a,
     1472.updated a {
     1473    color: var(--wp-admin-theme-color-darker-10);
    14681474    text-decoration: underline;
    14691475}
    14701476
    1471 .updated a {
    1472     padding-bottom: 2px;
     1477.notice a:hover,
     1478.error a:hover,
     1479.updated a:hover {
     1480    color: var(--wp-admin-theme-color-darker-20);
     1481}
     1482
     1483.notice a:focus,
     1484.error a:focus,
     1485.updated a:focus {
     1486    box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
     1487    outline: 2px solid transparent;
     1488    border-radius: 2px;
    14731489}
    14741490
     
    14881504
    14891505.wp-core-ui .notice.is-dismissible {
    1490     padding-right: 38px;
     1506    padding-right: 48px;
    14911507    position: relative;
    14921508}
     
    14941510.notice-dismiss {
    14951511    position: absolute;
    1496     top: 0;
    1497     right: 1px;
     1512    top: 12px;
     1513    right: 12px;
    14981514    border: none;
    14991515    margin: 0;
    1500     padding: 9px;
     1516    padding: 0;
    15011517    background: none;
    1502     color: #787c82;
     1518    color: #1e1e1e;
    15031519    cursor: pointer;
     1520    width: 24px;
     1521    height: 24px;
     1522    display: flex;
     1523    align-items: center;
     1524    justify-content: center;
     1525    border-radius: 2px;
    15041526}
    15051527
    15061528.notice-dismiss:hover:before,
    1507 .notice-dismiss:active:before,
    1508 .notice-dismiss:focus:before {
    1509     color: #d63638;
     1529.notice-dismiss:active:before {
     1530    color: #1e1e1e;
     1531    opacity: 0.7;
    15101532}
    15111533
    15121534.notice-dismiss:focus {
    1513     box-shadow: 0 0 0 2px #2271b1;
     1535    box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
    15141536    /* Only visible in Windows High Contrast mode */
    15151537    outline: 2px solid transparent;
    15161538}
    15171539
     1540.notice-dismiss:focus:before {
     1541    color: #1e1e1e;
     1542}
     1543
    15181544.notice-success,
    15191545div.updated {
    1520     border-left-color: #00a32a;
    1521 }
    1522 
    1523 .notice-success.notice-alt {
    1524     background-color: #edfaef;
     1546    border-left-color: #4ab866;
     1547    background-color: #eff9f1;
     1548}
     1549
     1550.notice-success.notice-alt,
     1551div.updated.notice-alt {
     1552    background-color: #eff9f1;
    15251553}
    15261554
    15271555.notice-warning {
    1528     border-left-color: #dba617;
     1556    border-left-color: #f0b849;
     1557    background-color: #fef8ee;
    15291558}
    15301559
    15311560.notice-warning.notice-alt {
    1532     background-color: #fcf9e8;
     1561    background-color: #fef8ee;
    15331562}
    15341563
    15351564.notice-error,
    15361565div.error {
    1537     border-left-color: #d63638;
    1538 }
    1539 
    1540 .notice-error.notice-alt {
    1541     background-color: #fcf0f1;
     1566    border-left-color: #cc1818;
     1567    background-color: #fcf0f0;
     1568}
     1569
     1570.notice-error.notice-alt,
     1571div.error.notice-alt {
     1572    background-color: #fcf0f0;
    15421573}
    15431574
    15441575.notice-info {
    1545     border-left-color: #72aee6;
     1576    border-left-color: #3858e9;
     1577    background-color: transparent;
    15461578}
    15471579
    15481580.notice-info.notice-alt {
    1549     background-color: #f0f6fc;
     1581    background-color: transparent;
    15501582}
    15511583
     
    21832215    align-items: center;
    21842216    justify-content: space-between;
    2185     border-bottom: 1px solid rgb(0, 0, 0, 0.1);
     2217    border-bottom: 1px solid #c3c4c7;
    21862218}
    21872219
     
    21962228.postbox-header .handle-actions {
    21972229    flex-shrink: 0;
    2198     padding-inline-end: 6px;
    21992230}
    22002231
     
    22332264
    22342265.sortable-placeholder {
    2235     border: 2px solid var(--wp-admin-theme-color);
    2236     border-radius: 8px;
     2266    border: 1px dashed #c3c4c7;
    22372267    margin-bottom: 20px;
    2238     background: rgb(var(--wp-admin-theme-color--rgb), 0.04);
    22392268}
    22402269
     
    22442273    padding: 0;
    22452274    line-height: 1;
    2246     background: #ffffff;
    2247     border: 1px solid rgb(0, 0, 0, 0.1);
    2248     border-radius: 0;
    2249 }
    2250 
    2251 .postbox.closed .postbox-header {
    2252     border-bottom: none;
     2275}
     2276
     2277.postbox.closed {
     2278    border-bottom: 0;
    22532279}
    22542280
     
    22612287
    22622288.postbox .inside {
    2263     padding: 16px;
     2289    padding: 0 12px 12px;
    22642290    line-height: 1.4;
    22652291    font-size: 13px;
     
    22742300
    22752301.postbox .inside {
    2276     margin: 0;
     2302    margin: 11px 0;
    22772303    position: relative;
    22782304}
     
    24552481.metabox-holder h2.hndle {
    24562482    font-size: 14px;
    2457     padding: 16px;
     2483    padding: 8px 12px;
    24582484    margin: 0;
    24592485    line-height: 1.4;
Note: See TracChangeset for help on using the changeset viewer.