-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Components: Fix Styling for TextControland TextAreaControl in dark themes
#69640
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
Components: Fix Styling for TextControland TextAreaControl in dark themes
#69640
Conversation
eacf2d2 to
f470385
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. |
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.
Thanks for the PR, @im3dabasia! I tested it across all available themes, and everything looks great ✅.
| TextControl | TextareaControl |
|---|---|
![]() |
![]() |
P.S. This PR is a part of the following tracker #69646
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.
Thanks for the PR!
I don't think using a transparent background color to be compatible with dark themes is the right approach.
For example, if there is a coloured background behind the control, it's difficult to see the text. I think this isn't what we want:
| trunk | This PR |
|---|---|
![]() |
![]() |
I'm not sure what is the best approach to make components fully compatible dark themes for now, but it would be good to discuss in #69639 #69646 before moving this PR forward.
I think the most important thing is to ensure that the control background color and the text have sufficient contrast, no matter what color the control background is.
P.S. This issue should be related to #69639: #44116
cc @WordPress/gutenberg-components
Thanks for the review @t-hamano ! The related issue #69639 is closed and marked as completed. I believe this is the updated issue tracker: #69646 |
|
I am attaching the screenshots of the changes below. Please take a look. I look forward to your feedback. TextControl
TextareaControl
cc: @t-hamano , @ciampo , @yogeshbhutkar |
c8fc768 to
35dcf7f
Compare
35dcf7f to
989a0d0
Compare
| &:focus { | ||
| border-color: $components-color-accent; | ||
| box-shadow: 0 0 0 0.5px $components-color-accent; | ||
| // Windows High Contrast mode will show this outline, but not the box-shadow. | ||
| outline: 5px solid transparent; | ||
| } |
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.
It looks like you're overriding the focus styles applied using the input-style__focus mixin here.
As per @ciampo's review (in my PR), I'm refining the mixin to support custom accents. Once/If this PR gets merged, you can rebase and use input-style__focus with custom accents directly, as recommended here.
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.
SGTM — let's wait for #69638 to land, so that the input-style__focus can be re-used
|
Hi @im3dabasia, the PR #69638 has just landed. If possible, could you rebase and refactor the changeset as discussed earlier? Thanks! |
989a0d0 to
95dd4bc
Compare
02a9bba to
14c091a
Compare
|
If you rebase this PR, the CI failure will be fixed. See #70034. |
14c091a to
93ae414
Compare
t-hamano
left a comment
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.
LGTM!
93ae414 to
d774b13
Compare
…k themes (WordPress#69640) Co-authored-by: im3dabasia <[email protected]> Co-authored-by: yogeshbhutkar <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: ciampo <[email protected]> Co-authored-by: Mamaduka <[email protected]>
















What?
Closes #69639
This PR introduces theming support for the
TextControlandTextAreaControlcomponents.Why?
This enhancement is necessary because the previous fixed styling approach left components visually inaccessible in dark mode environments, creating poor contrast and readability issues that compromised user experience.
How?
The corresponding SCSS files have been updated to use theming.
Testing Instructions
Screenshots
TextControl
Light mode
Dark mode
TextAreaControl
Light mode
Dark mode