JSPM

react-style-object-to-css

1.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11923
  • Score
    100M100P100Q132512F
  • License MIT

Convert react style with object to inline css(string).

Package Exports

  • react-style-object-to-css

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-style-object-to-css) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Summary

Convert React style defined as an object to pure inline css (string).

Installation

    npm install react-style-object-to-css

Example

const reactToCSS = require('react-style-object-to-css')
const styleObj = {
    backgroundColor: 'blue',
    fontSize: 14
}

// result === "background-color: blue;  font-size: 14px;"
const result = reactToCSS(styleObj)