how to access css variables with js code example
Example 1: how to change css variable in javascript
document.documentElement.style.cssText = "--main-background-color: red";
Example 2: js set css variable
document.documentElement.style.setProperty("--main-background-color", "green");