|
1 |
| -<h1 align="center"> css-style-inject </h1> |
| 1 | +[](https://www.npmjs.com/package/css-style-inject) |
| 2 | +[](http://commitizen.github.io/cz-cli/) |
| 3 | +[](https://github.com/semantic-release/semantic-release) |
| 4 | +[](https://dependabot.com) |
| 5 | + |
| 6 | + |
2 | 7 |
|
3 |
| -<hr/> |
4 | 8 |
|
5 |
| -<p> |
6 |
| - This is a plugin to inject styles to document head dynamically and it checks injections by unique id to prevent style duplication. |
7 |
| -</p> |
| 9 | +# CSS Style Injector |
| 10 | + |
| 11 | +## Installation |
8 | 12 |
|
9 |
| -<h3> List of features </h3> |
| 13 | +### npm |
10 | 14 |
|
11 |
| -<ul> |
12 |
| - <li>To attach styles: <code>injectCSS('..css', 'uniqueId')</code></li> |
13 |
| - <li>To detach styles: <code>detachCSS('uniqueId')</code></li> |
14 |
| -</ul> |
| 15 | +```terminal |
| 16 | +npm i css-style-inject |
| 17 | +``` |
15 | 18 |
|
16 |
| -<h3> Download & Installation </h3> |
| 19 | +### yarn |
17 | 20 |
|
18 |
| -```shell |
19 |
| -$ npm i css-style-inject |
| 21 | +```terminal |
| 22 | +yarn add css-style-inject |
20 | 23 | ```
|
21 |
| -<h3>Contributing</h3> |
22 |
| -Keep it simple. Keep it minimal. |
23 | 24 |
|
24 |
| -<h3>Authors or Acknowledgments</h3> |
25 |
| -<ul> |
26 |
| - <li>Kher Phay Chang</li> |
27 |
| -</ul> |
| 25 | +<hr/> |
28 | 26 |
|
29 |
| -<h3>License</h3> |
| 27 | +## Usage |
| 28 | +Add this to your javascript/ typescript file |
30 | 29 |
|
31 |
| -This project is licensed under the ISC License |
| 30 | +### attach styles to head |
| 31 | +```typescript |
| 32 | +import { injectCSS } from "css-style-inject"; |
| 33 | +injectCSS('..css', 'uniqueId'); |
| 34 | +``` |
| 35 | + |
| 36 | +### detach styles from head |
| 37 | +```typescript |
| 38 | +import { detachCSS } from "css-style-inject"; |
| 39 | +detachCSS('uniqueId') |
| 40 | +``` |
0 commit comments