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
Merged

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 requested a review from jorgefilipecosta Nov 2, 2021
@mirka mirka requested a review from ciampo Nov 15, 2021
Copy link
Contributor

@ciampo ciampo left a comment

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!)

Loading

Copy link
Contributor

@jasmussen jasmussen left a comment

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.

Loading

ciampo
ciampo approved these changes Nov 16, 2021
Copy link
Contributor

@ciampo ciampo left a comment

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

Loading

@jasmussen
Copy link
Contributor

@jasmussen jasmussen commented Nov 16, 2021

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

Loading

@mirka mirka merged commit 070c722 into trunk Nov 19, 2021
20 checks passed
Loading
@mirka mirka deleted the fix/color-picker-blue branch Nov 19, 2021
@github-actions github-actions bot added this to the Gutenberg 12.1 milestone Nov 19, 2021
c4rl0sbr4v0 pushed a commit that referenced this issue Dec 1, 2021
* ColorPicker: Replace hardcoded "blue" with theme color

* Update changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants