[EuiProgress] Add support for more colors#4130
Conversation
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4130/ |
cchaos
left a comment
There was a problem hiding this comment.
This is a nice expansion of the color prop to allow consumers to easily color with our visualization palette. 😍
The one thing that's not quite addressed in this PR that #3618 is asking for, is to be able to completely customize the color by passing a valid hex or rgb or other valid color type. That's where this can get complicated.
I wonder if it can be done similarly to EuiIcon, where a custom color gets applied in the inline style tag as the text color like style={{ color: customColor }} and then in the CSS we use currentColor to color the fill.
The only thing is that we couldn't then apply the makeHighContrastColor() mixin for the text color, but we could either caveat the example description with this or we do have a way to increase the contrast of a color in JS for just the text portion.
@cchaos I didn't know about |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4130/ |
I looked through some of our components where I thought we were using it, but we don't seem to have this exact implementation of changing the actual color. So I think we could just put a callout in the docs saying that we don't do any adjustment for contrast when applying the custom color to the text. |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4130/ |
cchaos
left a comment
There was a problem hiding this comment.
Updates are great. Here's a code review.
Looks like we're missing tests for the color prop. You'll also want to be sure to add one specifically for the custom color as well.
Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4130/ |
… into colorful-progress
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4130/ |
1 similar comment
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4130/ |
|
@cchaos thanks for the review. I addressed the feedback and added tests (we were also missing one for |
cchaos
left a comment
There was a problem hiding this comment.
Nice! Looks great! I tested in Chrome, FF, and Safari and they all render the proper color. 👍
@chandlerprall Want to take a quick peak at the JS side?
| }); | ||
|
|
||
| describe('color', () => { | ||
| [...COLORS, '#885522'].forEach((color) => { |
Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4130/ |
|
I think CI is failing on Prettier of the |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4130/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4130/ |
Summary
EuiProgress(tint1totint9),warningandsuccess.Note: Colors
successandsecondaryuse the same color, I've leftsecondaryas an option thinking of consumers that might already be usingsecondaryin their current implementations.Fixes #4117 #3618
Checklist
- [ ] Props have proper autodocs- [ ] Checked Code Sandbox works for the any docs examples- [ ] Checked for breaking changes and labeled appropriately- [ ] Checked for accessibility including keyboard-only and screenreader modes