How to use create-emotion - 5 common examples

To help you get started, we’ve selected a few create-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 / packages / create-emotion / types / tests.ts View on Github external
import createEmotion from 'create-emotion'

// $ExpectType Emotion
const emotion0 = createEmotion()
// $ExpectType Emotion
const emotion1 = createEmotion({
  container: document.head !== null ? document.head : undefined,
  nonce: 'fasefw'
})

// $ExpectError
createEmotion('abc')
// $ExpectError
createEmotion({}, undefined as any)

const {
  flush,
  hydrate,
  cx,
  merge,
github emotion-js / emotion / packages / create-emotion / types / tests.ts View on Github external
import createEmotion from 'create-emotion'

// $ExpectType Emotion
const emotion0 = createEmotion()
// $ExpectType Emotion
const emotion1 = createEmotion({
  container: document.head !== null ? document.head : undefined,
  nonce: 'fasefw'
})

// $ExpectError
createEmotion('abc')
// $ExpectError
createEmotion({}, undefined as any)

const {
  flush,
  hydrate,
  cx,
  merge,
  getRegisteredStyles,
  css,
github emotion-js / emotion / packages / create-emotion / types / tests.ts View on Github external
import createEmotion from 'create-emotion'

// $ExpectType Emotion
const emotion0 = createEmotion()
// $ExpectType Emotion
const emotion1 = createEmotion({
  container: document.head !== null ? document.head : undefined,
  nonce: 'fasefw'
})

// $ExpectError
createEmotion('abc')
// $ExpectError
createEmotion({}, undefined as any)

const {
  flush,
  hydrate,
  cx,
  merge,
  getRegisteredStyles,
  css,
  injectGlobal,
  keyframes,
  sheet,
  cache
} = emotion0
github interactivethings / catalog / packages / core / src / emotion.js View on Github external
if (context.__CATALOG_EMOTION_INSTANCE__ === undefined) {
  context.__CATALOG_EMOTION_INSTANCE__ = {};
}

export const {
  flush,
  hydrate,
  cx,
  merge,
  getRegisteredStyles,
  injectGlobal,
  keyframes,
  css,
  sheet,
  caches
} = createEmotion(context.__CATALOG_EMOTION_INSTANCE__, {
  // The key option is required when there will be multiple instances in a single app
  key: "catalog"
});
github mongodb / leafygreen-ui / packages / emotion / src / emotion.ts View on Github external
function createEmotionInstance() {
  const head = document.head;
  const config = {
    container: document.createElement('div'),
    key: 'leafygreen-ui',
  };

  head.insertBefore(config.container, head.firstChild);

  return createEmotion(config);
}

create-emotion

The Next Generation of CSS-in-JS.

MIT
Latest version published 4 years ago

Package Health Score

80 / 100
Full package analysis

Popular create-emotion functions