0.2.0 • Published 6 years ago

@mojule/object-to-css-string v0.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

object-to-css-string

npm install @mojule/object-to-css-string

const CssString = require( '@mojule/object-to-css-string' )

const style = {
  '.foo .bar': {
    fontSize: '10pt',
    margin: 0
  }
}

console.log( CssString( style ) )

const complexStyle = {
  '@import url( "other.css" )': null,
  '.foo .bar': {
    textSize: '1rem',
    margin: 0
  },
  '@supports (display: flex)': {
    '@media screen and (min-width: 900px)': {
      '.foo .bar': {
        textSize: '1.25rem',
        margin: 0
      }
    }
  }
}

console.log( CssString( complexStyle ) )