38 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
# style-inject
 | 
						|
 | 
						|
[](https://npmjs.com/package/style-inject) [](https://npmjs.com/package/style-inject) [](https://circleci.com/gh/egoist/style-inject/tree/master)  [](https://github.com/egoist/donate) [](https://chat.egoist.moe)
 | 
						|
 | 
						|
Inject style tag to document head.
 | 
						|
 | 
						|
## Installation
 | 
						|
 | 
						|
```bash
 | 
						|
npm install style-inject
 | 
						|
```
 | 
						|
 | 
						|
## Example
 | 
						|
 | 
						|
```javascript
 | 
						|
import styleInject from 'style-inject';
 | 
						|
const css = `
 | 
						|
  body {
 | 
						|
    margin: 0;
 | 
						|
  }
 | 
						|
`;
 | 
						|
styleInject(css, options);
 | 
						|
```
 | 
						|
 | 
						|
## Options
 | 
						|
 | 
						|
### insertAt
 | 
						|
 | 
						|
Type: `string`<br>
 | 
						|
Possible values: `top`<br>
 | 
						|
Default: `undefined`
 | 
						|
 | 
						|
Insert `style` tag to specific position of `head` element.
 | 
						|
 | 
						|
## License
 | 
						|
 | 
						|
MIT © [EGOIST](https://github.com/egoist)
 |