Natural Preference for Minification
Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

obj-css

0.0.1 • Public • Published

obj-css

Parse js obj model to css

Roughly an quick inverse of fritx/css-obj

Usage

Source:

[
  [
    '.hidden', {
      'display': 'none'
    }
  ],
  [
    'a:hover, .btn.active', {
      'display': 'block',
      'color': 'yellow'
    }
  ]
]

Parsing:

var parseCss = require('obj-css')
parseCss(cssObj, function(err, css){
  console.log(css)
})

Outputs:

.hidden {
  display: none;
}
a:hover.btn.active {
  display: block;
  color: yellow;
}

Install

npm i obj-css

DownloadsWeekly Downloads

1

Version

0.0.1

License

none

Last publish

Collaborators

  • avatar