adoptStyleInShadowRoot

Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.dom.css

This function allows you to make a shadowRoot element adopt his host context styles

Params

  1. $shadowRoot*-HTMLShadowRootElement

    The shadow root you want to adopt the $context styles

  2. $context”document”HTMLElement

    The context from which you want to adopt the styles

Return

  1. -Promise

    Return a promise fullfilled when the styles have been adopted

Example

import { adoptStyleInShadowRoot } from '@blackbyte/sugar/css';
const myShadowRoot = $myElement.shadowRoot;
await adoptStyleInShadowRoot(myShadowRoot);

Todo

  • testsnormal

Author