Skip to content

Commit 59c45cf

Browse files
committed
fix: update readme.md
1 parent 5f9d838 commit 59c45cf

File tree

1 file changed

+30
-21
lines changed

1 file changed

+30
-21
lines changed

readme.md

+30-21
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,40 @@
1-
<h1 align="center"> css-style-inject </h1>
1+
[![https://img.shields.io/npm/v/css-style-inject](https://img.shields.io/npm/v/css-style-inject)](https://www.npmjs.com/package/css-style-inject)
2+
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
3+
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
4+
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=sebgroup/frontend-tools)](https://dependabot.com)
5+
![https://img.shields.io/npm/l/css-style-inject](https://img.shields.io/npm/l/css-style-inject)
6+
![npm bundle size](https://img.shields.io/bundlephobia/minzip/css-style-inject)
27

3-
<hr/>
48

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
812

9-
<h3> List of features </h3>
13+
### npm
1014

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+
```
1518

16-
<h3> Download & Installation </h3>
19+
### yarn
1720

18-
```shell
19-
$ npm i css-style-inject
21+
```terminal
22+
yarn add css-style-inject
2023
```
21-
<h3>Contributing</h3>
22-
Keep it simple. Keep it minimal.
2324

24-
<h3>Authors or Acknowledgments</h3>
25-
<ul>
26-
<li>Kher Phay Chang</li>
27-
</ul>
25+
<hr/>
2826

29-
<h3>License</h3>
27+
## Usage
28+
Add this to your javascript/ typescript file
3029

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

Comments
 (0)