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

feat: show scrollbar on hover #5

Open
hyunbinseo opened this issue May 29, 2023 · 0 comments
Open

feat: show scrollbar on hover #5

hyunbinseo opened this issue May 29, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@hyunbinseo
Copy link
Owner

Hiding Webkit scrollbar cannot be reverted. reference

::-webkit-scrollbar {
  display: none;
}

Therefore, the Webkit scrollbar should be hidden only when it satisfies

  • Show scrollbar option is enabled.
  • Not using a pointer: fine device.
  • The component is not being hovered.

The following code works in Chrome and Firefox, but not in macOS Safari1.

.scroller-js {
  scrollbar-width: none;
}

@media not (pointer: fine) {
  .scroller-js::-webkit-scrollbar {
    display: none;
  }
}

@media (pointer: fine) {
  .scroller-js:not(:hover)::-webkit-scrollbar {
    display: none;
  }
  .scroller-js:hover {
    scrollbar-width: auto;
  }
}

Footnotes

  1. 16.4(18615.1.26.110.1)

@hyunbinseo hyunbinseo added the enhancement New feature or request label May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant