fluent-svelte icon indicating copy to clipboard operation
fluent-svelte copied to clipboard

Custom ScrollView component

Open tropicaaal opened this issue 3 years ago • 2 comments

Cross-browser scrollbar theming is enraging

  • Webkit has pretty decent theming support, but ::-webkit-scrollbar also has a lot of limitations.
  • Firefox has less to none customization, and pretty much only allows you to hide the scrollbar or change basic colors around.

To get around this, I want to design a custom ScrollView component, that still uses native scrolling but adds our own DOM-based scrollbar component to accurately replicate WinUI's ScrollViewer.

Considerations:

  • Accessibility (of course)
  • Progressive Enhancement - I want the native scrollbars to be visible when JS is disabled or before hydration.
  • Performance - scroll events are weird sometimes
  • Keyboard Navigation
  • Component-level scrolling customizations (binding to scrollX/scrollY, etc...)

A good starting place would probably be looking at how https://www.radix-ui.com/docs/primitives/components/scroll-area does it.

tropicaaal avatar Jan 24 '22 15:01 tropicaaal

something I would like if this were to be added would be the ability to use the scrollbar itself as a component (give it a height + offset) where it doesn't have a scrollable content area. Is this something you'd consider, even as just an internal component to be used to make a more general ScrollView / Scroll Area component? (wait, is that what the last consideration means)

paperclover avatar Feb 19 '22 05:02 paperclover

something I would like if this were to be added would be the ability to use the scrollbar itself as a component (give it a height + offset) where it doesn't have a scrollable content area. Is this something you'd consider, even as just an internal component to be used to make a more general ScrollView / Scroll Area component? (wait, is that what the last consideration means)

ScrollBar would be an internal component I could export, yeah.

tropicaaal avatar Mar 06 '22 00:03 tropicaaal