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

Custom classes to scrollbar and thumb elements #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Custom classes to scrollbar and thumb elements #22

wants to merge 1 commit into from

Conversation

bambeusz
Copy link

the lib is great, but in my project i need funcionality I added. It's just about adding custom classes to thumb and scrollbar elements.

autoUpdate: false, // Autoupdate the scrollbar if DOM changes. Needs MutationObserver or a polyfill to be available
thumbClass: [], // custom classes to be added to thumb
scrollbarClass: [], // custom classes to be added to scroll-bar
scrollBarOffsetTop: 0, //additional offset to position scrollbar
Copy link
Owner

Choose a reason for hiding this comment

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

Can these offsets not be applied using CSS and the custom classes?

Copy link
Owner

Choose a reason for hiding this comment

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

I see now you're using it in the calculation. Let's modify this to be an object. Like:

scrollbarOffset: {
   top: 0,
   bottom: 0,
   left: 0,
   right: 0
}

Also there's a naming inconsistency scrollbarClass vs scrollBarOffset...

Copy link
Author

Choose a reason for hiding this comment

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

There's css problem with left offset. If applied it messes up position of scrollbar.
I'd apply only top, bottom and right offset, or would not apply any, and leave it to custom class

I did not analyze the code good enough to manipulate offset so easily. Should I just remove offsetting and mark an issue?

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.

2 participants