How to use the postcss-js.parse function in postcss-js

To help you get started, we’ve selected a few postcss-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github postcss / postcss-loader / test / support / cases / exec.js View on Github external
var postcssJs = require('postcss-js');

var style = {
    a: {
        color: 'green'
    }
};

module.exports = postcssJs.parse(style);
github postcss / postcss-loader / test / fixtures / jss / exec / style.exec.js View on Github external
'use strict'

const postcssJS = require('postcss-js')

const style = {
  a: {
    color: 'green'
  }
}

module.exports = postcssJS.parse(style)
github emotion-js / emotion / packages / babel-plugin-emotion / src / parser.js View on Github external
const numOfComposes: number = !composeMatches ? 0 : composeMatches.length
      composes += numOfComposes
      vars += numOfComposes
      decl.remove()
    }
  })

  const styles = expandCSSFallbacks(
    extractStatic ? staticProcessor(root) : processor(root)
  )

  return {
    styles,
    staticCSSRules:
      vars === 0 && extractStatic
        ? stringifyCSSRoot(postcssJs.parse(styles))
        : [],
    composesCount: composes
  }
}

postcss-js

PostCSS for CSS-in-JS and styles in JS objects

MIT
Latest version published 1 year ago

Package Health Score

70 / 100
Full package analysis