change root css with js code example Example: change root color js document.documentElement.style.setProperty('--your-variable', '#YOURCOLOR');