Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jxnblk/object-style
https://github.com/jxnblk/object-style
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jxnblk/object-style
- Owner: jxnblk
- Archived: true
- Created: 2018-09-16T16:30:29.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-21T14:24:32.000Z (about 6 years ago)
- Last Synced: 2024-07-19T15:02:35.687Z (4 months ago)
- Language: JavaScript
- Size: 200 KB
- Stars: 33
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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