This can be done using a bit of Javascript.
<script>
document.documentElement.setAttribute('class',
'ontouchend' in document ? 'touch' : 'no-touch');
</script>
(make sure this line is placed before CSS - desktop browsers will not style CSS otherwise.)
Pre-fix with the ::webkit-scrollbar-*class .no-touchto make sure that only non-touch devices get the scroll bar style, but Android doesn't.
.no-touch ::-webkit-scrollbar {
width: 5px;
}
.no-touch ::-webkit-scrollbar-track {
background: rgba(0,0,0,0.5);
}
. Touch .