Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-universal-css-prop

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-universal-css-prop

Converts the `css` prop to a function call inside of `className`.

  • 0.1.0-alpha.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-universal-css-prop

Build Status

Converts the css prop to a function call inside of className.

<div css={{ color: 'red' }} />

💫

import _cssProp from 'css-in-js-lib'

<div className={_cssProp({ color: 'red' })} />

The _cssProp function must return a string.

Installation

npm i --save-dev babel-plugin-universal-css-prop

Then add the plugin to your .babelrc file:

{
  "plugins": [
    "@babel/plugin-syntax-jsx",
    ["babel-plugin-universal-css-prop", { "packageName": "css-in-js-lib" }]
  ]
}

You must define a mandatory packageName option that is the CSS in JS library that exposes the css function that is called with the css prop expression (content).

If the function you want to use is not the default package export you can use the importName option:

{
  "plugins": [
    ["babel-plugin-universal-css-prop", {
      "packageName": "emotion",
      "importName": "css"
    }]
  ]
}

FAQs

Package last updated on 25 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc