Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/jxnblk/object-style


https://github.com/jxnblk/object-style

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

# object-style

Convert style objects into CSS rules and classNames

- Framework agnositic
- One dependency
- Small (< 0.8 kb)
- Supports pseudoclasses
- Supports media queries

```sh
npm i object-style
```

```js
import objectStyle from 'object-style'

const { className, css } = objectStyle({
color: 'magenta',
backgroundColor: 'cyan',
fontSize: '48px',
'@media screen and (min-width:40em)': {
fontSize: '64px'
},
'&:hover': {
color: 'black'
},
'@media screen and (min-width:56em)': {
'&:hover': {
color: 'navy'
}
}
})
```

MIT License