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

[EuiButtonGroup] Improve interaction states #4142

Merged

Conversation

elizabetdev
Copy link
Contributor

@elizabetdev elizabetdev commented Oct 15, 2020

Summary

Closes #4105.

This PR improves the EuiButtonGroup interaction states.

complex-form@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

@elizabetdev elizabetdev marked this pull request as draft October 15, 2020 17:52
@kibanamachine
Copy link

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

@cchaos
Copy link
Contributor

cchaos commented Oct 15, 2020

Unfortunately this going to have a pretty big conflict with #4056 which is why it's been put into draft mode. We'll want to wait til that PR gets merged first as it completely re-works the styles because of the updated component structure.

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@elizabetdev elizabetdev marked this pull request as ready for review October 19, 2020 18:05
@elizabetdev elizabetdev requested a review from cchaos October 19, 2020 18:05
@kibanamachine
Copy link

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

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.

Thanks for tackling this one. Sorry for the conflicts that surely ensued. I'm visually ok with more pronounced selected state, but it did create a few visual regressions.

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@elizabetdev elizabetdev changed the title [EuiButtonGroup] Improve focus, selected and disabled states when compressed [EuiButtonGroup] Improve interaction states Oct 21, 2020
@elizabetdev
Copy link
Contributor Author

@cchaos thanks for your previous feedback.

I decided to make all the interaction states for the EuiButtonGroup similar. The only difference is that the compressed buttons have a focus ring.

The best way to test the changes is to replace the files src-docs/src/views/button/button_group.js and src-docs/src/views/form_compressed/complex_example.js with https://gist.github.com/miukimiu/13064cd5fa1345ff39a8569a0ceddfe8.

Then in /forms/compressed-forms#complex-example you can test the compressed EuiButtonGroup versions. And in /navigation/button#button-groups you can test the non-compressed versions.

@kibanamachine
Copy link

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

@elizabetdev elizabetdev requested a review from cchaos October 21, 2020 13:41
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.

👍 LGTM. Thanks for those gists for testing!

The only possibly one thing you might want to tweak is the hover state affecting the text color. It is causing the text color to change in some instances like the Warning and Success colors, and the Text color in dark mode.

Screen Recording 2020-10-21 at 12 14 32 PM

Screen Recording 2020-10-21 at 12 11 18 PM

* Medium and Small sizing (regular button style)
*/

// sass-lint:disable nesting-depth
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd guess this lint disable is not needed anymore?

@elizabetdev
Copy link
Contributor Author

@cchaos the .is-selected hover states affecting the texts were on purpose.

I thought it didn't have enough contrast when the background gets darker:
Screen Recording 2020-10-21 at 06 57 PM

So I decided to use the chooseLightOrDarkText() based on the contrast:
Screen Recording 2020-10-21 at 06 59 PM

Is it too much? 😛

@kibanamachine
Copy link

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

@cchaos
Copy link
Contributor

cchaos commented Oct 21, 2020

I'm thinking that in general the buttons are going too dark on hover. We should probably be consistent with our base buttons which only darken by 5% in default theme, which we should use in Amsterdam too.

@kibanamachine
Copy link

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

@elizabetdev elizabetdev merged commit a61138c into elastic:master Oct 22, 2020
@monfera
Copy link

monfera commented Oct 26, 2020

Thanks a lot @miukimiu @cchaos @snide, looks great!

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.

[EuiButtonGroup] Compressed selected button is hard to see
4 participants