An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# insert-styles [![Build Status](https://travis-ci.org/bendrucker/insert-styles.svg?branch=master)](https://travis-ci.org/bendrucker/insert-styles) [![Greenkeeper badge](https://badges.greenkeeper.io/bendrucker/insert-styles.svg)](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)