Horje
how to change a css variable with javascript Code Example
how to change a css variable with javascript
var root = document.querySelector(':root');
root.style.setProperty('--variable', 'lightblue');
/or/
root.style.setProperty('--variable', myColor); 
how to change css variable in javascript
document.documentElement.setAttribute("style", "--main-background-color: green");
js set css variable
document.documentElement.style.setProperty("--main-background-color", "green");
change css variable with javascript
let root = document.documentElement;

root.addEventListener("mousemove", e => {
  root.style.setProperty('--mouse-x', e.clientX + "px");
  root.style.setProperty('--mouse-y', e.clientY + "px");
});




Javascript

Related
error:03000086:digital envelope routines::initialization error Code Example error:03000086:digital envelope routines::initialization error Code Example
mongoose find if starts with Code Example mongoose find if starts with Code Example
json encode js Code Example json encode js Code Example
jquery preventdefault Code Example jquery preventdefault Code Example
zip code regex Code Example zip code regex Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7