scroll-view.css 980 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. .scroll-view {
  2. position: relative;
  3. overflow: hidden;
  4. }
  5. .scroll-view__viewport {
  6. height: 100%;
  7. width: 100%;
  8. overflow-y: auto;
  9. scrollbar-width: none;
  10. outline: none;
  11. display: flex;
  12. flex-direction: column-reverse;
  13. overflow-anchor: none;
  14. }
  15. .scroll-view__viewport::-webkit-scrollbar {
  16. display: none;
  17. }
  18. .scroll-view__thumb {
  19. position: absolute;
  20. right: 0;
  21. top: 0;
  22. width: 12px;
  23. transition: opacity 200ms ease;
  24. cursor: default;
  25. user-select: none;
  26. opacity: 0;
  27. }
  28. .scroll-view__thumb::after {
  29. content: "";
  30. position: absolute;
  31. left: 50%;
  32. transform: translateX(-50%);
  33. top: 0;
  34. bottom: 0;
  35. width: 4px;
  36. border-radius: 9999px;
  37. background-color: var(--border-weak-base);
  38. backdrop-filter: blur(4px);
  39. transition: background-color 150ms ease;
  40. }
  41. .scroll-view__thumb:hover::after,
  42. .scroll-view__thumb[data-dragging="true"]::after {
  43. background-color: var(--border-strong-base);
  44. }
  45. .scroll-view__thumb[data-visible="true"] {
  46. opacity: 1;
  47. }