rgba(hexcode, 0.8) is invalid CSS. You could do the following instead;
:root{
--errorColor: 255, 102, 93;
}
::-webkit-scrollbar-thumb {
background-color: rgba(var(--errorColor), 0.8);
}
Source
I spent a while trying to figure out why the background-color wasn't getting applied to the scrollbar thumb, but it seems someone else has figured it out before me. Please refer to @AHaworth's answer and @TemaniAfif's comment on his answer
(setting appearance: none
or overflow: auto
on ::webkit-scrollbar)
Extra note: if you want the colour to only apply to the div's scrollbar you can do
#div::-webkit-scrollbar {
appearance: none;
}
#div::-webkit-scrollbar-thumb {
background-color: rgba(var(-errorColor), 0.8);
}