I have a setup where there is a flexbox with three columns, each of which can be scrollable depending on their content.
Here is the Codepen link for reference: https://codepen.io/michaelkonstreu/pen/GRmzeJy
My goal is to add a small margin left between the content (column) and scrollbar when it is available or visible.
I attempted to achieve this using a CSS approach mentioned in this Stack Overflow post.
::-webkit-scrollbar {
width: 14px;
}
::-webkit-scrollbar-thumb {
border: 4px solid rgba(0, 0, 0, 0);
background-clip: padding-box;
border-radius: 9999px;
background-color: #AAAAAA;
}
However, I would like to keep the default browser scrollbar style while adding my custom margin to it. So I modified the CSS to:
::-webkit-scrollbar {
width: 14px;
}
::-webkit-scrollbar-thumb {
border: 4px solid rgba(0, 0, 0, 0);
background-clip: padding-box;
}
Unfortunately, this change resulted in the scrollbar not being displayed at all.
My question: How can I add a margin left (border left) property to the default browser scrollbar while maintaining the rest of the scrollbar styles intact?