JSFiddle - React, Tailwind, and code Playground
HTML
<div></div>
<style title="scrollbar">
div {
height: 1000px;
width: 1000px;
background-color: red;
}
::-webkit-scrollbar {
background-color: blue;
}
</style>
JavaScript
for(var i = 0; i < document.styleSheets.length; i++) {
var sheet = document.styleSheets[i];
if(sheet.title == 'scrollbar') {
for(var j = 0; j < sheet.rules.length; j++) {
var rule = sheet.rules[j];
if(rule.cssText.match("webkit-scrollbar")) {
rule.style.backgroundColor="yellow";
}
}
}
}