injectStyle

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

Inject a passed style string in the DOM

Params

  1. style*-String

    The style to inject in DOM

  2. settingsnullPartial<TInjectStyleSettings>

    Some settings to configure your injection

Return

  1. -HTMLStyleElement

    The injected HTMLStyleElement node

Example

import { injectStyle } from '@blackbyte/sugar/dom';
injectStyle('a { color: red; }');

Settings

  1. id*-String

    An id for the injected style tag

  2. rootNode*-HTMLElement

    A node in which to inject the style

Todo

  • testsnormal