-
-
Notifications
You must be signed in to change notification settings - Fork 99
Styling
Murhaf Sousli edited this page Jan 3, 2020
·
16 revisions
The scrollbars can be easily customized using the CSS variables
<ng-scrollbar class="my-scrollbar">
<!-- content -->
</ng-scrollbar>
Here are all available CSS variables:
.my-scrollbar {
--scrollbar-border-radius: 7px;
--scrollbar-padding: 4px;
--scrollbar-viewport-margin: 0;
--scrollbar-track-color: transparent;
--scrollbar-wrapper-color: transparent;
--scrollbar-thumb-color: rgba(0, 0, 0, 0.2);
--scrollbar-thumb-hover-color: var(--scrollbar-thumb-color);
--scrollbar-size: 5px;
--scrollbar-hover-size: var(--scrollbar-size);
--scrollbar-thumb-transition: height ease-out 150ms, width ease-out 150ms;
--scrollbar-track-transition: height ease-out 150ms, width ease-out 150ms;
}
If the CSS variables are not enough, custom classes can be used to override the styles, here is an example:
<ng-scrollbar trackClass="scrollbar" thumbClass="scrollbar-thumb">
<!-- content -->
</ng-scrollbar>
::ng-deep {
.scrollbar {
background-color: rgba(0, 0, 0, 0.4);
border-radius: 4px;
}
.scrollbar-thumb {
background-color: rgba(161, 27, 27, 0.4);
}
}
Become a sponsor and get your logo on our README on GitHub and the front page of https://ngx-scrollbar.netlify.com/.
Become a backer and get your logo on our README on GitHub.
Latest version (v15)
Addons:
Older version (v13)
- Demo for v13
- Usage
- Styling
- Global Options
- Pointer Events
- Scroll Event
- Updated Event
- Smooth Scroll Functions
- Performance tweak
- Integration
- Reached events