css-styles

1.0.2 • Public • Published

css-styles

Build Status Dependency Status

NPM

Parse and stringify inlined CSS declarations

Example

const cssStyles = require('css-styles')
 
var styles = cssStyles.parse('background: #bada55; font-size: 12px')
console.log(styles)
// {
//   background: '#bada55',
//   fontSize: '12px'
// }
 
var styleString = cssStyles.stringify({position: 'absolute'})
console.log(styleString)
// 'position: absolute;'

Usage

cssStyles.parse(string)

Parse a string containing CSS declarations and returns an object. Keys will be camelCase.

cssStyles.stringify(styles={})

Convert an object containing CSS declarations in to a string. Keys will be decamelized.

Install

$ npm install css-styles

License

MIT

Versions

Current Tags

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

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    1
  • 1.0.1
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i css-styles

Weekly Downloads

3

Version

1.0.2

License

MIT

Last publish

Collaborators

  • timhudson