umarmughal / css-paint-polyfill

A polyfill for the CSS Paint API, with special browser optimizations.

Home Page:https://googlechromelabs.github.io/css-paint-polyfill/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

css-paint-polyfill

Houdini's CSS Paint Polyfill npm

This is a polyfill for the CSS Paint API.

Performance is quite good in Firefox and Safari courtesy of -webkit-canvas() and -moz-element(). For the remaining browsers, framerate is governed by Canvas toDataURL() / toBlob() speed.

CSS Paint Polyfill demo

Usage

<script src="css-paint-polyfill.js"></script>
<!-- or: -->
<script src="https://unpkg.com/css-paint-polyfill/dist/css-paint-polyfill.js"></script>

Or with a bundler:

import 'css-paint-polyfill';

... or with ES Modules on the web:

import('https://unpkg.com/css-paint-polyfill/dist/css-paint-polyfill.js');

To-Do

  • Add second options argument to addModule() (spec)
  • Extract addModule() into its own repo (spec)

About

A polyfill for the CSS Paint API, with special browser optimizations.

https://googlechromelabs.github.io/css-paint-polyfill/

License:Apache License 2.0


Languages

Language:JavaScript 100.0%