Add value CSS variable for input, in order to be able to be styled from CSS
input {
appearance: none;
background: linear-gradient(to right, #f06 calc(1% * var(--value)), white 0);
}
<input type=range>
for (let input of document.querySelectorAll('input')) {
input.style.setProperty('--value', input.value);
}
document.addEventListener('input', e => {
input.style.setProperty('--value', e.target.value);
});