Julien-Marcou/Scrollable-Component

why not add variable of thumb cursor?

coader opened this issue · 4 comments

cursor:pointer is better the default

Hi,

I was looking to make the scrollbar feel like a native scrollbar, and native scrollbars use cursor: default;, so that's why I didn't use cursor: pointer;

I could have added a CSS variable to control that, but as I pointed out in a previous pull request #1 (comment), I will move on to the new ::part() CSS spec instead of CSS properties (variables), which will allow anybody to change any CSS value of any parts of the component.

I your case, that would mean adding the following CSS:

scrollable-component::part(scrollbar-thumb) {
  cursor: pointer;
}

There is no stable release yet for this, however, there is a preview version that you can install and try:
npm install scrollable-component@next

This is a breaking change release, so you'll have to migrate some of your existing code, here is the full changelog: v2.0.0-next.0

got it, thanks, and if v2 has demo page?

Actually, the demo website https://scrollable.julien-marcou.fr/ is running the v2 😄

And there is some code examples in the changelog.

very cool