Appearance
Function: addStyles()
ts
function addStyles(target: HTMLElement | ShadowRoot, elementId?: string): void;Defined in: src/assistant-api-utils/createSkillMountRoot.ts:26
Copy style tags from the document head into a target ShadowRoot or HTMLElement.
Parameters
| Parameter | Type | Description |
|---|---|---|
target | HTMLElement | ShadowRoot | The ShadowRoot or HTMLElement to receive the styles. |
elementId? | string | Optional ID of an iframe element whose styles to copy. |
Returns
void
Example
ts
const shadowRoot = element.attachShadow({ mode: 'open' });
addStyles(shadowRoot, 'matterway-skill-styles');