Custom Scrollbar CSS #34
-
Please describe the feature you would like to request.I would like to be able to specify a class on the What is the use-case or motivation for this proposal?For custom scrollbar css to be easily added. Is there anything else we should know?Example of custom scrollbar CSS:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This is quite easy to achieve... The scrollbar container inside the grid has the css class Let's define the class pbl-ngrid.with-custom-scrollbar {
.pbl-ngrid-scroll-container::-webkit-scrollbar-track {
background-color: rgba(128, 128, 128, .5);
}
.pbl-ngrid-scroll-container::-webkit-scrollbar {
width: 6px;
}
.pbl-ngrid-scroll-container::-webkit-scrollbar-thumb {
background-color: #ff4081;
}
.pbl-ngrid-scroll-container::-webkit-scrollbar-corner {
background-color: #424242;
}
.pbl-ngrid-scroll-container::-webkit-resizer {
background-color: #424242;
}
}
Now in the grid <pbl-ngrid class="with-custom-scrollbar"></pbl-ngrid> You can see it working in the following stackblitz https://stackblitz.com/edit/pebula-ngrid-starter-custom-scrollbar?file=app/app.component.html |
Beta Was this translation helpful? Give feedback.
-
Thanks for your in-depth answer! I had tried overriding a few different things but must have missed that class. Thanks again! |
Beta Was this translation helpful? Give feedback.
This is quite easy to achieve...
The scrollbar container inside the grid has the css class
pbl-ngrid-scroll-container
Let's define the class
with-custom-scrollbar
that if set on the grid's element will trigger a custom scrollbar style: