Modificar root em javascript

document.documentElement.style.setProperty('--your-variable', '#YOURCOLOR');
Rolly Craft