CSS3 & CSS var & :root How to change CSS :root color variables in JavaScript https://stackoverflow.com/questions/37801882/how-to-change-css-root-color-variables-in-javascript https://developer.mozilla.org/en-US/docs/Web/CSS/:root :root { --angleBe…
css var all in one number :root{ --num: 0; } html{ --num: 0; } let html = document.querySelector(`html`); html.style.setProperty(`--num`, `${angle}deg`); demo OK https://codepen.io/xgqfrms/pen/JQVPzx /* :root{ --num: 30; } */ html{ /* --num: 30; */ -…