is it possible to change the color of the scrollbar #437
Replies: 8 comments 6 replies
-
Yes, you can change everything else as well with a little bit of CSS. You can read more about it in the documentation here: https://kingsora.github.io/OverlayScrollbars/#!documentation/styling |
Beta Was this translation helpful? Give feedback.
-
@KingSora I'm not getting the point, trying to change the scrollbar's color and bg, but can't find the solution. If I paste this code with changes into
Or it should be done in another way? |
Beta Was this translation helpful? Give feedback.
-
@KingSora , sadly, it seems that I'm experiencing some kind of a bug. Plugin is not initializing anymore and custom styles are not applied. While the |
Beta Was this translation helpful? Give feedback.
-
@KingSora thanks to your help I was able to properly init the library. I've to add it to these rules:
I'm placing this |
Beta Was this translation helpful? Give feedback.
-
@01Kuzma its intended to use the css custom props and the .my-theme.os-scrollbar {
/* Your styles here.. */
} and then if you want to apply this style to your instance you can do: // use the options object when initializing
OverlayScrollbars(myElement, {
scrollbars: {
theme: 'my-theme'
}
});
// or use .options for already initialized scrollbars
osInstance.options({
scrollbars: {
theme: 'my-theme'
}
}); |
Beta Was this translation helpful? Give feedback.
-
@KingSora , thank you for the clarifications! |
Beta Was this translation helpful? Give feedback.
-
@KingSora unfortunately I'm not a topic starter and don't have this button active :( |
Beta Was this translation helpful? Give feedback.
-
I am also having issues with this, I'm using react and css modules. I defined my theme globally in my .os-theme-custom.os-scrollbar {
--os-handle-bg: red;
--os-size: 5px;
} And am applying it to the element as follows: <ScrollOverlay className={styles.scrollOverlay} ref={tableScrollRef} events={{ scroll: () => scrollEvent.current?.() }} options={{ scrollbars: { theme: "os-theme-custom" } }} defer> But nothing changes, I think that the documentation could be a little clearer on how to do this, a pretty big part of wanting to use this library is for the custom scrollbar styling. |
Beta Was this translation helpful? Give feedback.
-
Hello my question is simple, it is possible to change the color of the scrollbar to my liking
Beta Was this translation helpful? Give feedback.
All reactions