docs.rodeo

MDN Web Docs mirror

CSS: paintWorklet static property

{{APIRef("CSSOM")}} {{SeeCompatTable}} {{SecureContext_Header}} 

The static, read-only paintWorklet property of the {{DOMxRef("CSS")}}  interface provides access to the paint worklet, which programmatically generates an image where a CSS property expects a file.

Value

The associated {{DOMxRef('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");
}

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN