2.0.0 • Published 9 years ago

inject-inline-style v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

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