Repository navigation
Conversation
…tem. See #64548. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test using WordPress PlaygroundThe 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
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
I appreciate the motivation and agree with it. However hard coding the notice colors means they remain incompatible with |
|
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: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
|
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? |
|
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. |
|
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. |
|
Created https://core.trac.wordpress.org/ticket/66777, and edited this issue to point to it. Let me know if that works! |
|
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 |
From my POV, no. I pose that question on to other reviewers before I update the PR, though. |
|
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>
|
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? |

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:
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:
It is worth noting that since this change adds a corner radius—same corner radius used for widgets—some plugins will have rounding:
There's also a use of the Notice inside the customizer, which as a result gets a 0px radius to avoid this:
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:
Thank you for your time.
Use of AI Tools
Claude Opus 5.