JSPM

insert-styles

1.2.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 429
  • Score
    100M100P100Q91140F
  • License MIT

Insert CSS styles into an HTML document

Package Exports

  • insert-styles

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (insert-styles) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.

License

MIT © Ben Drucker