I'm trying to get Mouse X,Y and set them to my.css file's customvalue
:root{
--mouse-x:0px;
}
in ejs file, it load css file <link ~ my.css id="mcss">
and
<script>
var el = document.getElementByID('mcss');
<--Get Mouse X, save to var x-->
el.style.setProperty('--mouse-x',x+"px");
</script>
But It doesn't works well When I tried with document.stylesheets[0].rules[0] it works well. What's the difference?