@mojule/object-to-css-string
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

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 ) )

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

    Package Sidebar

    Install

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

    Weekly Downloads

    19

    Version

    0.2.0

    License

    MIT

    Unpacked Size

    11.7 kB

    Total Files

    16

    Last publish

    Collaborators

    • andybell
    • nrkn