inject-inline-style
v2.0.0
Published
Inject an object as an inline CSS string.
Downloads
1
Maintainers
Readme
inject-inline-style
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>