Replies: 2 comments 2 replies
-
Maybe the problem i'm facing is similar to yours. Also looking for a solution here. textarea::-webkit-scrollbar{
width: 8px;
height: 8px;
}
textarea::-webkit-scrollbar-thumb{
border-radius: 16px;
} Commonly we can apply these rules to normal HTML element and it will work but not md components. Is there any token I should use instead? Or this is just not supported yet? |
Beta Was this translation helpful? Give feedback.
-
I've been looking into this issue of scrollbar styling, and I think I've found a solution based on how the official Material Web Components catalog handles it. It appears the catalog itself implements custom scrollbar styling. I found the relevant code in the This snippet demonstrates the approach they are using to style the scrollbars. It looks like they're using a combination of CSS pseudo-elements ( This example provides a solid starting point for anyone looking to implement cross-browser custom scrollbar styling within their Material Web Components project. You can adapt the CSS rules to match your specific design requirements. It might be helpful to document this approach more clearly in the Material Web Components documentation itself. Perhaps a dedicated section on styling scrollbars would be beneficial. I'd be happy to contribute a PR if that's something the maintainers would consider. Let me know if this helps, or if you have any further questions! |
Beta Was this translation helpful? Give feedback.
-
This question arose because it is possible to add some css to the window scrollbar.
The default browser scroll bar kind of clashes with the rounded design of the components.
That led me to look around to see if there was some documentation on how to have your bits of css like that blend well with the components in the library.
Is there anything like that already and I couldn't find it?
If it doesn't exist would there be something in the pipeline for that soon?
Or do I have to just wing it the best I can?
Beta Was this translation helpful? Give feedback.
All reactions