https://github.com/bendrucker/insert-styles
Insert CSS styles into an HTML document
https://github.com/bendrucker/insert-styles
Last synced: 10 months ago
JSON representation
Insert CSS styles into an HTML document
- Host: GitHub
- URL: https://github.com/bendrucker/insert-styles
- Owner: bendrucker
- License: mit
- Created: 2015-10-07T23:16:43.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2019-08-19T22:00:03.000Z (almost 7 years ago)
- Last Synced: 2025-09-11T16:53:05.867Z (11 months ago)
- Language: JavaScript
- Homepage:
- Size: 20.5 KB
- Stars: 16
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# insert-styles [](https://travis-ci.org/bendrucker/insert-styles) [](https://greenkeeper.io/)
> Insert CSS styles into an HTML document
## Install
```
$ npm install --save insert-styles
```
## Usage
```js
var insertStyles = require('insert-styles')
insertStyles('h1 { font-size: 14px }')
//=> h1 { ... }
```
## API
#### `insertStyles(styles, [options]) -> void`
##### styles
Required. The string of styles to insert into the DOM.
##### options
###### id
Calling `insertStyles` with the same `options.id` multiple times will re-use the same `` element each time.
## Related
* [insert-css](https://github.com/substack/insert-css)
## License
MIT © [Ben Drucker](http://bendrucker.me)