0.1.4 • Published 8 years ago

@f/to-inline-style v0.1.4

Weekly downloads
42
License
MIT
Repository
github
Last release
8 years ago

to-inline-style

Build status Git tag NPM version Code 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