On a page I am having a webkit scrollbar which has been hidden using display: none css property.
#element::-webkit-scrollbar {
display: none;
}
In one of my app level css files I tried to override the above css rule, but I wasn't able to display the scrollbar
I tried changing the css but I couldn't the get exact scrollbar which would have been there if display: none property was not present.
#element::-webkit-scrollbar {
-webkit-appearance: none;
width: 7px;
display: block;
}
#element::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: rgba(0,0,0,.5);
-webkit-box-shadow: 0 0 1px rgba(255,255,255,.5);
}
The above css made the scroll bar visible but it gave me ugly scroll bar (probably due the css rules I have used).
Is there a simple way in which I can display the webkit scrollbar which would been there if the display:none property was not present. I can not change the display:none as it is being inherited by my app. I can only over-ride that rule.
EDIT:
An exactly similar question was asked How to override "::-webkit-scrollbar" CSS rule and make scrollbar visible again, but it seems that also doesn't have an accepted answer.
allow-scroll, then select with#element:not(.allow-scroll)::-webkit-scrollbarfor yourdisplay: none. Then just add/remove the class with JavaScript.::-webkit-scrollbaronly supports in Chrome Browser !