inject-inline-style

2.0.0 • Public • Published

inject-inline-style

NPM version License

Inject an object as an inline CSS string.

Installation

npm install inject-inline-style

Usage

var injectStyle = require('inject-inline-style')
 
var style = injectStyle({
  '.button': {
    color: 'red'
  },
  '.button:hover': {
    color: 'blue'
  }
})
 
console.log(style) // => ".button{color:red}.button:hover{color:blue}"

Which injects the following into the HTML document's <head>:

<style type="text/css">.button{color:red}.button:hover{color:blue}</style> 

See also

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    1
  • 1.0.0
    0

Package Sidebar

Install

npm i inject-inline-style

Weekly Downloads

1

Version

2.0.0

License

MIT

Last publish

Collaborators

  • gummesson