npm

obj-to-css

1.0.1 • Public • Published

Table of Contents

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.

    Package Sidebar

    Install

    npm i obj-to-css

    Weekly Downloads

    197

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • tiaanduplessis