Skip to main content

Home > blockly > blockRendering > ConstantProvider > createDom

blockRendering.ConstantProvider.createDom() method

Create any DOM elements that this renderer needs (filters, patterns, etc).

Signature:

createDom(svg: SVGElement, tagName: string, selector: string, injectionDivIfIsParent?: HTMLElement): void;

Parameters

ParameterTypeDescription
svgSVGElementThe root of the workspace's SVG.
tagNamestringThe name to use for the CSS style tag.
selectorstringThe CSS selector to use.
injectionDivIfIsParentHTMLElement(Optional) The div containing the parent workspace and all related workspaces and block containers, if this renderer is for the parent workspace. CSS variables representing SVG patterns will be scoped to this container. Child workspaces should not override the CSS variables created by the parent and thus do not need access to the injection div.

Returns:

void