shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
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
- style*-String
The style to inject in DOM
- settingsnullPartial<TInjectStyleSettings>
Some settings to configure your injection
Return
- -HTMLStyleElement
The injected HTMLStyleElement node
Example
import { injectStyle } from '@blackbyte/sugar/dom';
injectStyle('a { color: red; }');Settings
- id*-String
An id for the injected style tag
- rootNode*-HTMLElement
A node in which to inject the style
Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space