css-style-inject
v1.1.3
Published
This is a plugin to inject styles to document head dynamically and it checks injections by unique id to prevent style duplication.
Downloads
83
Maintainers
Readme
CSS Style Injector
Installation
npm
npm i css-style-inject
yarn
yarn add css-style-inject
Usage
Add this to your javascript/ typescript file
attach styles to head
import { injectCSS } from "css-style-inject";
injectCSS('..css', 'uniqueId');
detach styles from head
import { detachCSS } from "css-style-inject";
detachCSS('uniqueId')