0.0.1 • Published 3 years ago

css-houdini-pixels v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years ago

CSS Houdini Worklet Name

A CSS Houdini Worklet to show connected nodes.

CSS Houdini [Worklet Name]

Getting started

1. Load the worklet

Using CDN is the easiest way to add the library:

if ('paintWorklet' in CSS) {
  CSS.paintWorklet.addModule('[URL]');
}

Or, download the latest Worklet name and import it to your web page:

if ('paintWorklet' in CSS) {
  CSS.paintWorklet.addModule('[LOCAL_PATH]');
}

You can use the polyfill

To add support for all moder browsers, you can load the worklet with css-paint-polyfill fallback.

<script>
  ;(async function() {
    if (CSS['paintWorklet'] === undefined)
      await import('https://unpkg.com/css-paint-polyfill')

    CSS.paintWorklet.addModule('./[file].js')
  })()
</script>

3. Ready to use it in your CSS!

To use Worklet Name worlet you need define some custom properties with values and add the value paint([worklet_name]) on background-image property.

The worklet has default values if you don't define these

.element {
  /* CSS code */
}
propertydescriptiondefault value
--workletName

License

MIT License

Copyright (c) 2020 CSS Houdini