Event

render

Dispatched after the doodle has rendered, on the first render and after every update.

Syntax

  • doodle.addEventListener('render', handler)

The event bubbles and crosses shadow boundaries. It is dispatched asynchronously after the code is applied, so the rendered size can be measured in the handler. When the code uses @doodle, @shaders or @pattern, the cell styles wait for those images and may not be in place yet; after an update the previous styles stay until then.

Examples

const doodle = document.querySelector('css-doodle');

doodle.addEventListener('render', () => {
  console.log('rendered with seed', doodle.seed);
});

See also