JonHMChan / descartes

Descartes | Write CSS in JavaScript
https://descartes.io/slides
MIT License
444 stars 21 forks source link

Virtual DOM Compatibility #30

Open HighOnDrive opened 8 years ago

HighOnDrive commented 8 years ago

Descartes looks like a great way to handle CSS. It would be really great if it could work with virtual DOM API's like: Inferno, Snabbdom, Virtual-DOM and others. Working with Decartes in Cycle.js would be especially awesome!

JonHMChan commented 8 years ago

Yes, this is something I've been thinking about too. I think the major things Descartes would need in order for this to work are around triggering the application of styles based on events triggered by Virtual DOM libs. Descartes stores the style tree as a monolithic attribute and just does an initial render based on that tree, binding specific nodes for event listeners. Virtual DOM libs would just need a hook to fire the rendering methods of the library.