-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notice: Fix text contrast for dark mode #69226
Conversation
Size Change: +2 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
40f4da6
to
cc8f523
Compare
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Additional Context: I first noticed this problem when I suggested using the Notice component in the Site Editor (#69174 (comment)). If the Notice component did not have a black text color, the text would be very hard to see: |
I wonder why they do not use the same style as the WordPress admin notices. Those do not have a background color change, only border color change? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either way it is an improvement.
Does it need to be updated in the design system?
@@ -6,6 +6,7 @@ | |||
border-left: 4px solid $components-color-accent; | |||
padding: 8px 12px; | |||
align-items: center; | |||
color: $gray-900; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have two choices:
- keep
Notice
with hardcoded colors, regardless of light / dark mode. This is what we're doing now, and the changes proposed in this PR are definitely an improvement over what's ontrunk
; - make
Notice
follow the theme (including dark/light modes) and swap hardcodedbackground-color
andcolor
values for the dynamic ones — although that may require design feedback and potential updates to the Design System, as also @carolinan suggested.
Thank you everyone for your feedback.
I don't know why, but the I think there will need to be a few more discussions about whether to only change the border and not the background color, or whether to dynamically change the background/text color. Therefore, for now, I would like to ship this PR. |
Co-authored-by: t-hamano <[email protected]> Co-authored-by: carolinan <[email protected]> Co-authored-by: ciampo <[email protected]>
What?
See #66454 (comment)
Why?
The text in the
Notice
component has no explicit text color applied to it, so it will appear white in dark mode. As a result, the text will be invisible in most statuses.How?
Apply an explicit black text color. This value also matches the text color of the Placeholder component.
Testing Instructions
Launch Storybook and switch to dark mode.
Screenshots or screencast