momentum-css
v1.0.0
Published
Use JS events within your CSS
Downloads
8
Maintainers
Readme
Momentum
Add page events like tracking scroll position, mouse position, device orientation, and more to your CSS!
Installation
Add the js inside your <head>
tag.
Usage
All values are unitless meaning you will need to add your units to them. For example, calc(var(--scrolly)*1px)
results in a pixel value for the vertical scroll position.
Global variables
Element variables
To trigger element variables, add the class momentumcss
to your elemnt.