How to use the babel-plugin-emotion.default function in babel-plugin-emotion

To help you get started, we’ve selected a few babel-plugin-emotion 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 emotion-js / emotion / site / plugins / gatsby-remark-live-code / index.js View on Github external
}`
      )
    }
    if (
      node.lang === 'jsx' &&
      // yes, i know this won't work if you don't use line comments and stuff
      // but adding a whole js parser and stuff to do this would be more effort than it's worth
      livePattern.test(node.value)
    ) {
      let cleanValue = node.value.replace('// @live', '').trim()
      node.type = `html`
      node.value = escapeGoat.escapeTag``
    }
  })
}
github emotion-js / emotion / site / src / components / live / worker.js View on Github external
// https://github.com/developit/preact-www/blob/cb47a5015ea666930ead6eebc2917307db6c1db6/src/components/controllers/repl/worker.js

importScripts('https://unpkg.com/@babel/standalone@7.0.0/babel.min.js')

const babelPluginEmotion = require('babel-plugin-emotion').default

global.window = global

addEventListener('message', ({ data }) => {
  let { id, method, params } = data
  Promise.resolve()
    .then(() => ACTIONS[method](...[].concat(params)))
    .then(result => postMessage({ id, result }))
    .catch(({ message, loc }) => postMessage({ id, error: { message, loc } }))
})

const options = {
  presets: [
    'es2015',
    'react',
    [
github emotion-js / emotion / site / src / components / live / worker.js View on Github external
// https://github.com/developit/preact-www/blob/cb47a5015ea666930ead6eebc2917307db6c1db6/src/components/controllers/repl/worker.js

importScripts('https://unpkg.com/@babel/standalone@7.0.0/babel.min.js')

const babelPluginEmotion = require('babel-plugin-emotion').default

global.window = global

addEventListener('message', ({ data }) => {
  let { id, method, params } = data
  Promise.resolve()
    .then(() => ACTIONS[method](...[].concat(params)))
    .then(result => postMessage({ id, result }))
    .catch(({ message, loc }) => postMessage({ id, error: { message, loc } }))
})

const options = {
  presets: [
    'es2015',
    'react',
    [

babel-plugin-emotion

A recommended babel preprocessing plugin for emotion, The Next Generation of CSS-in-JS.

MIT
Latest version published 4 years ago

Package Health Score

88 / 100
Full package analysis

Popular babel-plugin-emotion functions