Skip to content

Administration: Update notices to align with the WordPress Design System - #16129

Open
jasmussen wants to merge 2 commits into
WordPress:trunkfrom
jasmussen:update/restyle-admin-notices-to-wpds
Open

jasmussen wants to merge 2 commits into
WordPress:trunkfrom
jasmussen:update/restyle-admin-notices-to-wpds

Conversation

@jasmussen

@jasmussen jasmussen commented Nov 20, 2026 •

Copy link
Copy Markdown

Trac ticket: https://core.trac.wordpress.org/ticket/66777

This patch updates the Notices to look like those that appear inside the site editor, and can be seen in this story. Here are some screenshots:

2026-11-20 11 34 21 localhost 170ff3b87359 2026-11-20 11 36 58 localhost 6c0ea53cbd01

I've aspired to keep the CSS changes minimal, as it's a visual change, and I've tested a bunch of the major plugins in it, including Woo which looks as it should:

2026-11-20 11 33 04 localhost 5cbfb14dbc87

It is worth noting that since this change adds a corner radius—same corner radius used for widgets—some plugins will have rounding:

2026-11-20 11 39 35 localhost a84c05cace47 2026-11-20 11 40 01 localhost 324e33c68823

There's also a use of the Notice inside the customizer, which as a result gets a 0px radius to avoid this:

2026-11-20 11 47 54 localhost b35a4db85830

Why

The motivation is the same as is outlined on the trac ticket: to unify the appearance of the same elements across WordPress. In this case, Notices.

The notice itself uses a full border and toned colour to indicate the type of notice. Not part of this patch, however, the addition of an icon for the type of notice—that's a larger undertaking due to how Notices work in WordPress, but still possibly one to undertake, as colour alone is insufficient to indicate notice type for people of low vision or colour blindness. In that sense, the change is largely stylistic, but the addition of a border all around nevertheless does increase contrast between the notice itself and the background canvas, especially for some colours, e.g. success notices can be hard to see the boundaries of at present:

image

Thank you for your time.

Use of AI Tools

Claude Opus 5.

…tem.

See #64548.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@jameskoster

Copy link
Copy Markdown

I appreciate the motivation and agree with it. However hard coding the notice colors means they remain incompatible with ThemeProvider. That is all to say; could/should we adopt color tokens here (presuming they're available)?

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props joen, jameskoster, peterwilsoncc, joedolson.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@jasmussen

Copy link
Copy Markdown
Author

Yes indeed! And I encountered that while working on this, but decided it might be best to do that separately? The point would be to replace all hard-coded colours across the admin with tokens, which would bring big improvements for contrast and notably high-contrast and dark mode theming options. But because it's a bigger thing, I decided to keep it separate for now. WDYT?

@jameskoster

Copy link
Copy Markdown

I guess that makes it a logistical question; if this and the token work are scheduled for the same release then would it make sense to wait for the token adoption and avoid touching notices twice? Or; leave the colors as they are, but adopt other aspects like the radius and stroke treatment.

If we're not using tokens there's a chance visual details might drift e.g. if the color algo changes (WordPress/gutenberg#86614). Not the end of the world, but overall I think I'd prioritise token adoption.

None of this is blocking, it's splitting hairs.

@peterwilsoncc

Copy link
Copy Markdown
Contributor

A follow up trac ticket would be great as the listed ticket is closed on a closed milestone. it will need to stay that way for tracking purposes.

@jasmussen

Copy link
Copy Markdown
Author

Created https://core.trac.wordpress.org/ticket/66777, and edited this issue to point to it. Let me know if that works!

@jasmussen

Copy link
Copy Markdown
Author

On whether to update to tokens or not, there's an additional question of whether to update instances of Dashicon usage:

image

Ultimately I think both are worth doing, but whether it's one PR or several, I will honestly defer to you.

@jameskoster

Copy link
Copy Markdown

The main question for me is; if we intend to adopt the tokens anyway, is there any reason not to do that now?

My read on the icons is to adopt WordPress/Icons everywhere we currently find Dashicons, but that seems separate.

@jasmussen

Copy link
Copy Markdown
Author

The main question for me is; if we intend to adopt the tokens anyway, is there any reason not to do that now?

From my POV, no. I pose that question on to other reviewers before I update the PR, though.

@joedolson

Copy link
Copy Markdown
Contributor

From an accessibility perspective, I think this is a beneficial change, for the same reason mentioned above - that the notice boundaries are hard to see in some cases. I think it will need to ship pretty early in the cycle, as there are a lot of scenarios where notices appear, and there are probably more than just the customizer that will need additional massaging to account for the addition of borders.

Adding icons is something I'm 100% in favor of; see https://core.trac.wordpress.org/ticket/50442, but it keeps getting stalled out due to the complexity of getting it to work effectively globally and getting design agreement. But with all the design integration work going on, this would potentially be a good time to try and move it forward.

…he Customizer.

Checking the new notice in the places it appears turned up three contexts that the change had not reached.

The login screen renders its messages through `wp_admin_notice()`, so its markup is already the admin's, but it does not load `common.css` and so kept the previous look: a 4px bar on one side, square corners and a white surface. `login.css` now repeats the notice paint, and messages take the tone their markup declares, so an instructional message is info-toned rather than carrying a brand-blue bar, and `notice-warning` and `notice-success` are styled there for the first time. Those values are duplicated from the notices section of `common.css` and have to be kept in step with it by hand.

Theme cards and the Customizer's notification containers set `border-radius: 0`. A notice in either place is a band pinned to its container's edges rather than a box of its own: a theme card clips the band at the card's own corner radius, so a radius on the band only pulls it away from that corner, and the Customizer's notices measure the full width of their container and stack flush, so a radius turns the stack into a column of rounded pills.

Padding and margins are unchanged throughout.

See #66777.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jasmussen

Copy link
Copy Markdown
Author

Thanks Joe, thanks all for the feedback. I pushed a small change to fix a corner radius issue in the customizer and in theme cards, but this should be good to go for any other manual reviews need to happen.

The main open question: tokenize or not?

I think Jay's reasons mentioned for why we should tokenize are solid: they protect against drift, and they are already available in the admin.

What I realised though is that those tokens are available in the admin, but not in the login screen. So out of an abundance of caution and simply because I think this change is worth shipping in 7.3 (early if possible, as Joe suggests) is more important than also tokenising at the same time.

So instead I opened a separate PR, #16198, which does the exact same thing as this PR, but tokenises all the Notice related values (colours, padding, borders), and adds the theme provider (tokens) to the login screen. That adds an additional 9KB, minified, to the login screen.

Both PRs should not ship, one should be closed in favour of the other. So the two exist as alternatives to pick from: tokenise now, or tokenise later. Penny for your thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants