Wiki: Building CSS Features your Browser Doesn’t Have Yet
For agents: Markdown version · Wiki index · Explore
- Speaker: Shay Davidson
- Event: Reversim Summit 2025
- Video: https://www.youtube.com/watch?v=9uon3gU7JrE
- Transcript: /transcripts/2025/08-9uon3gU7JrE.md
- Language: Hebrew · Type: talk · Level: advanced
- Topics: Frontend, Game Development, Performance
Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.
Summary
The speaker demonstrates how to build custom CSS features that are not yet natively supported in browsers by using the Houdini technology set. The presentation focuses on the CSS Object Model (CSSOM) for defining typed custom properties and paint worklets for rendering complex visuals off the main thread. Through live coding, the speaker shows how to create a high-performance procedural starfield animation driven entirely by CSS variables. Ultimately, developers learn how to offload heavy rendering tasks and improve reactivity and performance for visual components.
Key points
- 3:30 The speaker introduces CSS Houdini as a collection of browser APIs that expose parts of the CSS engine to allow developers to extend it.
- 5:36 Animating CSS gradients directly is challenging because the browser treats them as strings rather than values it can interpolate.
- 6:37 Using the CSSOM property API allows developers to define types for custom properties so the browser knows how to interpolate them for animations.
- 9:42 Paint worklets enable reactive drawing using CSS and canvas APIs on a separate thread, preventing performance degradation on the main thread.
- 22:42 A paint worklet is implemented as a class with a paint function that receives the canvas context, container dimensions, and custom properties.
- 51:54 Procedural drawing inside a paint worklet executes at 60 frames per second without blocking the main browser thread.
- 54:17 Using a seeded pseudo-random number generator ensures that procedural renders remain consistent when container dimensions change.
Takeaways
- Use CSSOM typed properties to enable smooth animations on custom CSS variables.
- Offload heavy visual rendering and procedural graphics to paint worklets running on a separate thread to maintain 60 FPS performance.
- Leverage CSS reactivity to automatically trigger redraws in paint worklets when container sizes or custom properties change.
Questions this talk answers
- How can I animate CSS gradients smoothly without relying on heavy JavaScript canvas loops?
- What is the difference between standard web workers and paint worklets in the browser?
- How do I pass typed CSS custom properties into a paint worklet?
Technologies
CSS, HTML5 Canvas, JavaScript
Tags
animations, canvas, css houdini, cssom, frontend, performance, web apis