CSS: paintWorklet static property
CSSOM
CSSOM
The static, read-only paintWorklet property of the CSS interface provides access to the
paint worklet, which programmatically generates an image where a CSS
property expects a file.
Value
The associated Worklet object.
Examples
The following example demonstrates loading a paint worklet from its js file and does so by feature detection.
if ("paintWorklet" in CSS) {
CSS.paintWorklet.addModule("checkerboard.js");
}