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

Add EuiColorPaletteDisplay #3865

Merged
merged 46 commits into from
Nov 5, 2020
Merged

Conversation

miukimiu
Copy link
Contributor

@miukimiu miukimiu commented Aug 5, 2020

Summary

Closes #3575

This PR adds a new component called EuiColorPaletteDisplay. This component used to be part of the EuiColorPalettePicker but it was decided to decouple the code from it. So it can be used on its own.

Issues that this component fix

When this component was part of the EuiColorPalettePicker I found a few issues that are now fixed:

  • We couldn't display only one color
  • Only gradient palettes could have stops. Now also fixed palettes can have stops.

Decisions

While developing this component I found a few issues that lead me to take a few decisions. Initially I was generating a css linear gradient to create fixed color palettes. But on Google chrome, the stops were getting blurred.

Screenshot 2020-10-26 at 19 07 58

For this reason, I tried to generate the linear gradient with an SVG <linearGradient /> but once again the stops were getting blurred.

The solution was to generate color stops with a flex container and spans. There was an issue to use the inset shadow with a flex container. For this reason, I used the mixin @include innerBorder('dark', $euiBorderRadius, .2); to generate the borders.

Final Solution

Color palette display@2x

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Safari, Edge, and Firefox
  • Props have proper autodocs
  • Added documentation
  • [ ] Checked Code Sandbox works for the any docs examples
  • Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3865/

@miukimiu
Copy link
Contributor Author

miukimiu commented Aug 6, 2020

jenkins test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3865/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3865/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3865/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3865/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3865/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3865/

@miukimiu miukimiu marked this pull request as ready for review October 27, 2020 16:55
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3865/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3865/

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

This is great! A couple TS changes and a couple questions below.

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3865/

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

I really like that the select box in the customize popover also accounts for the settings. 👍

Just a couple quick last comments.

@thompsongl
Copy link
Contributor

PR4U: miukimiu#6

EuiColorPaletteDisplay TypeScript assist
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3865/

@miukimiu
Copy link
Contributor Author

miukimiu commented Nov 4, 2020

Thanks @thompsongl and @cchaos,

I already merged the PR with the typescript assist and went through the last comments.

@miukimiu miukimiu requested a review from cchaos November 4, 2020 11:56
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3865/

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

🍰 Nice!

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

🎨 LGTM!

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3865/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Color Palette Display component
4 participants