insert-styles

1.2.1 • Public • Published

insert-styles Build Status

Insert CSS styles into an HTML document

Install

$ npm install --save insert-styles

Usage

var insertStyles = require('insert-styles')
 
insertStyles('h1 { font-size: 14px }')
//=> <head><style> h1 { ... }</style></head>

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 <style> element each time.

Related

License

MIT © Ben Drucker

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.2.1
    510
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.2.1
    510
  • 1.2.0
    2
  • 1.1.0
    0
  • 1.0.0
    104

Package Sidebar

Install

npm i insert-styles

Weekly Downloads

616

Version

1.2.1

License

MIT

Last publish

Collaborators

  • bendrucker