DEV Community

Discussion on: Sharing data between CSS and JavaScript using custom properties

Collapse
ben profile image
Ben Halpern

root.style.setProperty('--mouse-x', e.x);

This is really mind-blowing

Collapse
codepo8 profile image
Christian Heilmann Author

Also useful for scroll position, document dimensions, cursor position...