npm.io
1.0.1 • Published 9 years agoCLI

obj-to-css

Licence
MIT
Version
1.0.1
Deps
0
Vulns
0
Weekly
0

obj-to-css

Convert JS object to CSS declarations



Built with ︎ by Tiaan and contributors

Table of Contents

Table of Contents
  • About
  • Install
  • Usage
  • CLI
  • Contribute
  • License
  • Install

    $ npm install --save obj-to-css
    # OR
    $ yarn add obj-to-css

    Usage

    
    const ToCss = require('obj-to-css')
    
    const obj = {
      '.hello': {
        color: 'red'
      },
      '.foo': {
        background: 'pink'
      }
    }
    
    console.log(toCSS(obj)) // .hello{color:red}.foo{background:pink}
    

    CLI

    $ obj-to-css foo.json
    # .hello{color:red}.foo{background:pink}

    Contribute

    Contributions are welcome. Please open up an issue or create PR if you would like to help out.

    Note: If editing the README, please conform to the standard-readme specification.

    License

    Licensed under the MIT License.

    Keywords