-
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
Components: Deprecate COLORS.white
#67649
Conversation
@@ -70,7 +70,7 @@ export const buttonView = ( { | |||
} | |||
|
|||
&:active { | |||
background: ${ CONFIG.controlBackgroundColor }; |
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.
Removing this CONFIG
variable altogether since this is the only place it's used. (Part of #43997)
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. |
Size Change: 0 B Total Size: 1.83 MB ℹ️ View Unchanged
|
Flaky tests detected in a238566. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12184138076
|
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.
Code looking good 👍
Tested all affected components with default and dark themes, and this actually fixes a bunch of issues with the dark theme!
One thing I'd love a follow up on is the hover text color on the active navigation item - that seems to be broken on both default and dark themes. Should be done in a separate PR IMHO.
🚀
@@ -201,7 +201,7 @@ const baseItem = css` | |||
[aria-disabled='true'] | |||
) { | |||
background-color: ${ COLORS.theme.accent }; | |||
color: ${ COLORS.white }; | |||
color: ${ COLORS.theme.accentInverted }; |
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.
|
||
> button, | ||
> a { | ||
color: ${ COLORS.white }; | ||
color: ${ COLORS.theme.accentInverted }; |
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.
Still works well, but hover color still doesn't work well:
Should be fixable with something like:
diff --git a/packages/components/src/navigation/styles/navigation-styles.tsx b/packages/components/src/navigation/styles/navigation-styles.tsx
index 0cde6314685..8894065f66f 100644
--- a/packages/components/src/navigation/styles/navigation-styles.tsx
+++ b/packages/components/src/navigation/styles/navigation-styles.tsx
@@ -137,6 +137,7 @@ export const ItemBaseUI = styled.li`
color: ${ COLORS.theme.accentInverted };
> button,
+ > .components-button:hover,
> a {
color: ${ COLORS.theme.accentInverted };
opacity: 1;
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.
Seems to be working well, here's a PR: #67732
@@ -134,11 +134,11 @@ export const ItemBaseUI = styled.li` | |||
|
|||
&.is-active { | |||
background-color: ${ COLORS.theme.accent }; | |||
color: ${ COLORS.white }; | |||
color: ${ COLORS.theme.accentInverted }; |
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.
@@ -38,7 +38,7 @@ export const buttonView = ( { | |||
background: transparent; | |||
border: none; | |||
border-radius: ${ CONFIG.radiusXSmall }; | |||
color: ${ COLORS.gray[ 700 ] }; | |||
color: ${ COLORS.theme.gray[ 700 ] }; |
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.
@@ -39,7 +39,7 @@ export const toggleGroupControl = ( { | |||
content: ''; | |||
position: absolute; | |||
pointer-events: none; | |||
background: ${ COLORS.gray[ 900 ] }; | |||
background: ${ COLORS.theme.foreground }; |
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.
@@ -12,7 +12,6 @@ const CONTROL_PROPS = { | |||
controlPaddingXSmall: 8, | |||
controlPaddingXLarge: 12 * 1.3334, // TODO: Deprecate | |||
|
|||
controlBackgroundColor: COLORS.white, |
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.
👍
@@ -112,7 +112,7 @@ const isIconStyles = ( { | |||
}; | |||
|
|||
return css` | |||
color: ${ COLORS.gray[ 900 ] }; | |||
color: ${ COLORS.theme.foreground }; |
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.
@tyxla Thanks for highlighting the small improvements 😄 |
I was surprised how many of them we have in a single PR! Nice work 🚀 |
* Components: Deprecate `COLORS.white` * Add changelogs * Update snapshot Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org>
Part of #44116, #43997
What?
Deprecates the internal
COLORS.white
variable, replacing most of the usages to theme-ready variables.There are a few more usages in the package, but they are each a bit special so we'll deal with them separately.
Why?
COLORS.white
is not theme-ready, and we should prevent new usages in component styles.Testing Instructions
Check in Storybook that there are no visual regressions in the following component states. Use the theme tool in the toolbar to toggle to an example dark mode.
isDeselectable
mode.