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

Fixed scrollbar colors for dark mode #4969

Merged
merged 3 commits into from
Jul 21, 2021

Conversation

cchaos
Copy link
Contributor

@cchaos cchaos commented Jul 19, 2021

Fixes #4423

Uses the euiScrollBar() mixin at the html level and adding a 3rd parameter for $size with the default being thin (as it were) and allowing thick to maintain the larger size for the overall page.

Firefox: The thin usage used to be applied at the root level for Firefox, but now it's the thick version. This could mean Firefox instances of scrolling containers are no longer “thin” if consumers didn't manually apply the mixin. But Chrome would have been using the stock scrollbar anyway.

Safari: None of these styles affect Safari at the html level. But that's ok because it was already adhering to the theme switch.

BEFORE
image

AFTER
image

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 and playground toggles
  • [ ] 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

Uses the `euiScrollBar()` mixin at the `html` level and adding a 3rd parameter for `$size` with the default being `thin` (as it were) and allowing `thick` to maintain the larger size for the overall page.

Caveat: This could mean Firefox instances of scrolling containers are no longer “thin” if they don’t use the mixin.
@cchaos cchaos requested a review from miukimiu July 19, 2021 19:49
@kibanamachine
Copy link

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

Copy link
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

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

Tested and checked code. LGTM.

Copy link
Contributor

@miukimiu miukimiu left a comment

Choose a reason for hiding this comment

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

Tested in Chrome, Safari, Edge, Brave and Firefox. I also looked at the code and LGTM! 🎉

But I noticed something... In all browsers, the scrollbar only appears when we start scrolling except in Chrome.

This is a screenshot of what I'm seeing without even interacting with the page in Chrome. The scrollbar is visible by default.

Colors-Elastic-UI-Framework

Before this change, the scrollbar would only appear once we started scrolling.

Is this new behavior expected?

@cchaos
Copy link
Contributor Author

cchaos commented Jul 21, 2021

Oh interesting... it must be forcing this system preferences behavior. IIRC, the default setting is the second option. I have the first one checked, so there didn't seem to be any change for me. Wondering if it's truly a bad thing... 🤔
Screen Shot 2021-07-21 at 11 59 40 AM

I can see arguments for both:

  • Forcing an always visible scrollbar is more helpful for actually indicating that "this page scrolls"
  • Overriding a user's specified setting may be un-welcomed (but some may not even know its a setting)

One other plus, that I just checked on, is that with that first option checked when I only have a trackpad usage, it shows a scrollbar weirdly like this (on Chrome) which could then overlap necessary content.

image

As for mobile, I pulled it up on my phone and it didn't have any affect from before. So 👍 🤷

@kibanamachine
Copy link

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

@cchaos
Copy link
Contributor Author

cchaos commented Jul 21, 2021

I'm gonna merge in, and keep an ear out for any concerns. Thanks both!

@cchaos cchaos merged commit 1e5ff27 into elastic:master Jul 21, 2021
@cchaos cchaos deleted the fix/scrollbar_colors branch July 21, 2021 17:24
@ryankeairns
Copy link
Contributor

Thanks for this!

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.

EuiScrollBar colors for dark mode
5 participants