js change variables in css file code example
Example: how to change css variable in javascript
document.documentElement.style.setProperty("--main-background-color", "green");
document.documentElement.style.setProperty("--main-background-color", "green");