Skip to content
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 utils/colors-values.js file #40392

Closed
mirka opened this issue Apr 15, 2022 · 4 comments · Fixed by #43994
Closed

Components: Clean up utils/colors-values.js file #40392

mirka opened this issue Apr 15, 2022 · 4 comments · Fixed by #43994
Assignees
Labels
[Package] Components /packages/components

Comments

@mirka
Copy link
Member

mirka commented Apr 15, 2022

What problem does this address?

The bloated colors file is currently a pain point. It's blocking the work we'd like to do to migrate to a more CSS variables-centric approach, which then could enable theming.

We should be able to greatly simplify the colors file following @jasmussen's guidance:

We definitely want to retire #50505, and #000000 is a color we should very rarely use — mostly for shadows, not for UI elements.

To an extent, the whole list of colors in this file is wrong and outdated, and exists — I believe — mainly due to it being created at a time in the development where much of the design refresh from #18667 was still underway. In that light, I would consider lines 6-15 from the sass file as the canonical and single list of grayscale colors we should support in the component set, with var(--wp-admin-theme-color) rounding out the spot color.

If I had my way, I'd rename the G2 color palette to something more sensible, it was just a temporary codename. I'd also retire all the other palettes, DARK_GRAY, DARK_OPACITY, DARK_OPACITY_LIGHT, LIGHT_GRAY, LIGHT_OPACITY_LIGHT, and BLUE. No-one should use those colors, and if we need to maintain them for backwards compatibility, we should seek out a way to clearly communicate they are deprecated.

What is your proposed solution?

Let's clean up the file in small iterative steps, starting off by removing unused colors, consolidating duplicated references, etc.

@ciampo
Copy link
Contributor

ciampo commented Apr 22, 2022

As we work on this, we should also go through the steps highlighted in #40526 (comment) regarding border colors

@mirka
Copy link
Member Author

mirka commented Sep 8, 2022

As we work on this, we should also go through the steps highlighted in #40526 (comment) regarding border colors

I moved this task to #39425

@ciampo
Copy link
Contributor

ciampo commented Sep 9, 2022

Are the colors defined in the UI object still relevant, or do they need some cleanup too?

@mirka
Copy link
Member Author

mirka commented Sep 12, 2022

Are the colors defined in the UI object still relevant, or do they need some cleanup too?

I'm not exactly sure, but I think we'll be doing inventory/cleanup work on the UI object when we start to make those items themeable, starting with the border colors. I'm fine with leaving it for now (and it being continued to be used in new places) because it captures some semantic meaning that will likely be useful when doing any future refactor work (including theming).

@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants