Home

Awesome

object-style

Convert style objects into CSS rules and classNames

npm i object-style
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