Get the latest tech news

CSS Painting API


The CSS Painting API — part of the CSS Houdini umbrella of APIs — allows developers to write JavaScript functions that can draw directly into an element's background, border, or content.

JavaScript The setup and logic of the paint worklet is in the external script. To register the worklet, we need to call addModule() from our main script: Result While you can't play with the worklet's script, you can alter the custom property values in DevTools to change the colors and width of the background image.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of CSS Painting API

CSS Painting API

Photo of CSS Painting

CSS Painting