Bootstrap: Add scrollbar utility

Created on 18 Jun 2020  Â·  6Comments  Â·  Source: twbs/bootstrap

I'd suggest adding scrollbar utilities.

Firefox supports scrollbar-color and scrollbar-width properties since v64.
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Scrollbars

Webkit offers even more customization.
https://developer.mozilla.org/en-US/docs/Web/CSS/::-webkit-scrollbar

.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f5f5f5;
    scroll-behavior: smooth;
}
.scrollbar-thin::-webkit-scrollbar{
    width: 6px;
    height: 6px;
    background-color: #f5f5f5;
}
.scrollbar-thin::-webkit-scrollbar-thumb{
    border-radius: 10px;
    background-color: #c1c1c1;
}
.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background-color: #9d9d9d;
}

I hope this utility would make a scrollable sidebar and modal a little concise.

css feature v6

Most helpful comment

There's almost no browser support in our targetted browsers in v5:

  1. Firefox implements CSS WG standardized properties since 64, but we currently support above 60;
  2. WebKit & Blink browsers support non-standards pesudo-elements, the spec going to properties and not pseudo-elements…
  3. Edge Legacy has no support at all;
  4. all those implementations are buggy: Firefox does not support some values, iOS Safari can not make it work in WebView, etc.

Those properties clearly don't meet our requirement to be added as utilities in v5, as of now. I'll keep this open for further discussions–and keep an eye on this for v6?

All 6 comments

Here's the example on CodePen, https://codepen.io/aswinkumar863/pen/NWxgqRw

wooow it is a great feature. If are you interested. I can do a pull request with this feature @aswinkumar863

You can @MauricioHernanCabrera. But I don't get any comment about this feature from the bootstrap team.

You can @MauricioHernanCabrera. But I don't get any comment about this feature from the bootstrap team.

okasss

There's almost no browser support in our targetted browsers in v5:

  1. Firefox implements CSS WG standardized properties since 64, but we currently support above 60;
  2. WebKit & Blink browsers support non-standards pesudo-elements, the spec going to properties and not pseudo-elements…
  3. Edge Legacy has no support at all;
  4. all those implementations are buggy: Firefox does not support some values, iOS Safari can not make it work in WebView, etc.

Those properties clearly don't meet our requirement to be added as utilities in v5, as of now. I'll keep this open for further discussions–and keep an eye on this for v6?

Closing for now given this is _maybe_ something we’d do in v6.

Was this page helpful?
0 / 5 - 0 ratings