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