Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/we-lib/obj-css

Parse js obj model to css
https://github.com/we-lib/obj-css

Last synced: 23 days ago
JSON representation

Parse js obj model to css

Awesome Lists containing this project

README

        

# obj-css

Parse js obj model to css

Roughly an quick inverse of [fritx/css-obj](https://github.com/fritx/css-obj)

## Usage

Source:

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

Parsing:

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

Outputs:

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