https://github.com/tiaanduplessis/obj-to-css
Convert JS object to CSS declarations
https://github.com/tiaanduplessis/obj-to-css
convert css json object
Last synced: 3 months ago
JSON representation
Convert JS object to CSS declarations
- Host: GitHub
- URL: https://github.com/tiaanduplessis/obj-to-css
- Owner: tiaanduplessis
- License: mit
- Created: 2017-05-12T12:56:29.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-06-02T22:37:36.000Z (about 7 years ago)
- Last Synced: 2025-07-12T07:03:34.778Z (about 1 year ago)
- Topics: convert, css, json, object
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
obj-to-css
Convert JS object to CSS declarations
Table of Contents
Table of Contents
## Install
```sh
$ npm install --save obj-to-css
# OR
$ yarn add obj-to-css
```
## Usage
```js
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
```sh
$ 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](https://github.com/RichardLitt/standard-readme) specification.
## License
Licensed under the MIT License.