@f/to-inline-style
v0.1.4
Published
Convert style object to plain strings for inline html styles
Downloads
52
Readme
to-inline-style
Convert style object to plain strings for inline html styles.
Installation
$ npm install @f/to-inline-style
Usage
var toInlineStyle = require('@f/to-inline-style')
var inlineStyles = toInlineStyle({
'-webkit-user-select': 'none',
MsUserSelect: 'none',
userSelect: 'none',
color: 'blue'
})
// -> '-webkit-user-select:none;-ms-user-select:none;user-select:none;color:blue'
API
toInlineStyle(styleObject)
styleObject
- an object with style key, value pairs
Returns: A string representation of styleObject
which can be used in style
attributes
License
MIT