3 ms·
So a lot of that sounds good, and the Houdini stuff looks interesting, but how does "extending CSS" with JS or worklets solve the two main problems of CSS, name
by mmckelvy 7y ago
So a lot of that sounds good, and the Houdini stuff looks interesting, but how does "extending CSS" with JS or worklets solve the two main problems of CSS, namely the ability to define local styles and the ability to dynamically change or define styles on the fly?
Also, it doesn't look like browser support for those new APIs is going be very good for quite some time.
- err4nt 7y agoI'm not quite sure what you're asking about the 'two main problems of CSS' - can you explain more about what's problematic about defining 'local styles' or updating styles dynamically? CSS custom properties, which already do have browser support, are a wonderful example of allowing JS to set values that CSS is able to take and use dynamically - check out libraries like Splitting.js or ScrollMagic for examples of applications of that. Houdini worklets (pluggable Layout, Paint, Animation worklets) are definitely coming - this is what's currently being worked on as well as the 'Typed Object Model' for CSS where they're tightening the bolts and helping JS become aware of the different values and types inside the CSS language. Also, when looking at support, keep in mind that as of Jan 15th, Edge will have the same support as Chrome :D