CSS: paintWorklet static property

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{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.

js
if ("paintWorklet" in CSS) {
  CSS.paintWorklet.addModule("checkerboard.js");
}

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also