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

ColorPicker: Replace hardcoded "blue" with theme color #36153

Merged
merged 2 commits into from
Nov 19, 2021

Conversation

mirka
Copy link
Member

@mirka mirka commented Nov 2, 2021

Description

ColorPicker used a hardcoded blue color for its input prefixes, which can look quite random when users have different admin theme colors set. This PR replaces the hardcoded color with the UI theme color.

How has this been tested?

  • Storybook
  • In wp-admin Site Editor with a random admin theme color set

Screenshots

Before After
Hex prefix symbol has a hardcoded blue color Hex prefix symbol matches the theme color

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@mirka mirka added [Package] Components /packages/components [Feature] Component System WordPress component system labels Nov 2, 2021
@mirka mirka self-assigned this Nov 2, 2021
@mirka mirka requested a review from ajitbohra as a code owner November 2, 2021 18:33
@mirka mirka added the [Type] Bug An existing feature does not function as intended label Nov 4, 2021
@mirka mirka requested a review from ciampo November 15, 2021 18:05
Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code-wise, the changes LGTM!

The highlighted text in the color picker follows the selected theme:

color-picker-theme-color.mp4

Before merging, though, I'd like to get a blessing from @jasmussen too (thank you, Joen!)

Copy link
Contributor

@jasmussen jasmussen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, thank you! Definitely use the theme color for this in similar cases as well. I do suspect some time in the future, we'll want to revisit some of those color schemes for contrast and such, but that's entirely separate.

Note that I wasn't actually able to test this, I got an error:
Screenshot 2021-11-16 at 10 32 08

But I'm almost convinced that error was present in trunk at the time (14 days ago), and will be fixed if the PR is rebased.

Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review @jasmussen ! I mainly wanted to make sure that it's fine to use the admin theme color in this scenario :)

Note that I wasn't actually able to test this, I got an error:

I don't think this PR could have introduced this error, since it's a very simple JS (CSS) change. FWIW, I carried my tests via this link

@jasmussen
Copy link
Contributor

Yep, I recall those errors happening to unrelated branches. This looks good.

@mirka mirka merged commit 070c722 into trunk Nov 19, 2021
@mirka mirka deleted the fix/color-picker-blue branch November 19, 2021 16:47
@github-actions github-actions bot added this to the Gutenberg 12.1 milestone Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Component System WordPress component system [Package] Components /packages/components [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants