-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: Clean up unused and duplicate COLORS
values
#43445
Conversation
Size Change: -704 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
theme: 'var( --wp-admin-theme-color, #007cba)', | ||
themeDark10: 'var( --wp-admin-theme-color-darker-10, #006ba1)', |
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.
These fallback values will not matter in reality because the built style.css
file for the components package will include the CSS variable definitions.
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.
If only we had viz reg :dreaming: (although snapshots in this case also help a little bit in giving confidence on the rendered markup)
secondary: '#ccc', | ||
tertiary: '#e7e8e9', | ||
}, | ||
// Matches the grays in @wordpress/base-styles |
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 would great if we could, in the future, use the same values from @wordpress/base-styles
without having to manually re-state them.
We could either:
- declare those values in
@wordpress/base-styles
as CSS variables, OR - in the context of allowing some theming to
@wordpress/components
, expose some CSS variables and therefore allow consumers of the components package to override these values.
The second option would be my favourite, as it decouple the package better. But I also recognize that we can't expose every single value as a CSS variable, as it can quickly grow to become overwhelming.
|
||
const G2 = { |
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.
Good that we're getting rid of "g2" references, as they don't make much sense anymore!
@@ -48,7 +48,6 @@ const wrapperMargin = ( { marks, __nextHasNoMarginBottom }: WrapperProps ) => { | |||
}; | |||
|
|||
export const Wrapper = styled.div< WrapperProps >` | |||
color: ${ COLORS.blue.medium.focus }; |
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.
This line wasn't needed because color
was being assigned again a few lines later (${ wrapperColor };
)
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.
I wrote this down in the commit message so I don't forget, and then forgot to write it as a comment 😂 Sorry to make you sleuth!
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 🚀
Good to merge once snapshots are updated!
It's only used in the RangeControl Wrapper, and it always gets overriden by another color.
Part of #40392
What?
Clean up unused and duplicate color values in the
colors-values.js
file.We also add some better JSDoc guidance to prevent usage of deprecated colors.
Why?
The color value file is overwhelming and does not match the current direction of the components package. Our ultimate goal is to simplify and adhere to the color scheme defined in
@wordpress/base-styles
.How?
This first pass of the cleanup task focuses on removing unused and duplicate colors.
Testing Instructions
For easier code review, I recommend reading commit by commit.
In Storybook, do a smoke test of some of the affected components. Actual colors should not have changed.