RxCSS
RxCSS is a very small library for manipulating CSS Custom Properties (aka CSS Variables) with RxJS Observables.
More Info
- 📖 Read the slides: http://slides.com/davidkhourshid/reactanim#/
- 🎥 Watch the presentation: https://www.youtube.com/watch?v=lTCukb6Zn3g
Requirements
Make sure RxJS is installed and globally available.
Installation
You can either use RxCSS in an existing project:
npm install rxcss@latest --save
Or you can include it directly in a <script>
tag:
Usage
const mouse$ = RxObservable ; const style$ = ; // Optionalstyle$;
API
RxCSS(observableMap[, target])
Sets each key/value pair, where each value is an observable, as a CSS variable on the target.
observableMap
(Object) - an object where each:key
is the CSS variable name to be set on thetarget
value
is either an Observable stream of values, or a single value to set the CSS variable to.
target
(Element) - the DOM node to set the CSS variables to. Default:document.documentElement
.