Socket
Book a DemoInstallSign in
Socket

@charlietango/babel-preset-sx-prop

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@charlietango/babel-preset-sx-prop

Preset to consume the sx prop on all elements

latest
Source
npmnpm
Version
1.2.1
Version published
Weekly downloads
14
75%
Maintainers
1
Weekly downloads
 
Created
Source

@charlietango/babel-preset-sx-prop

A custom version of @emotion/babel-preset-css-prop to use the JSX Pragma from @charlietango/ui

Install

yarn add @charletango/babel-preset-sx-prop

Usage

.babelrc

{
  "presets": ["@charlietango/babel-preset-sx-prop"]
}

@charlietango/babel-preset-sx-prop includes the emotion plugin. The babel-plugin-emotion entry should be removed from your config and any options moved to the preset. If you use @babel/preset-react or @babel/preset-typescript ensure that @charlietango/babel-preset-sx-prop is inserted after them in your babel config.

Options

Options for both babel-plugin-emotion and @babel/plugin-transform-react-jsx are supported and will be forwarded to their respective plugin.

Refer to the plugin's documentation for full option documentation.

You can opt into the new JSX runtimes by configuring this preset with { runtime: 'automatic' }. Keep in mind that you have to use compatible React version (>=16.14.0) to use this option and a compatible version of @emotion/core (>=10.1.0).

Examples

{
  "presets": [
    "@emotion/babel-preset-css-prop",
    {
      "autoLabel": true,
      "labelFormat": "[local]",
      "useBuiltIns": false,
      "throwIfNamespace": true
    }
  ]
}

Options set to default values for demonstration purposes.

Keywords

emotion

FAQs

Package last updated on 05 Nov 2020

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