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