create-emotion
The Next Generation of CSS-in-JS.
Last updated 7 years ago by emotion-release-bot .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install create-emotion 
SYNC missed versions from official npm registry.

create-emotion

Create distinct instances of emotion.

The main emotion package can be thought of as a call to createEmotion with sensible defaults for most applications.

import createEmotion from 'create-emotion'

export const {
  flush,
  hydrate,
  cx,
  merge,
  getRegisteredStyles,
  injectGlobal,
  keyframes,
  css,
  sheet,
  cache
} = createEmotion()

Upside

  • Calling it directly will allow for some low level customization.

  • Create custom names for emotion APIs to help with migration from other, similar libraries.

  • Could set custom key to something other than css

Downside

  • Introduces some amount of complexity to your application that can vary depending on developer experience.

  • Required to keep up with changes in the repo and API at a lower level than if using emotion directly

Primary use cases

  • Using emotion in embedded contexts such as an <iframe/>

  • Setting a nonce on any <style/> tag emotion creates for security purposes

  • Use emotion with a developer defined <style/> tag

  • Using emotion with custom stylis plugins

Multiple instances in a single app example

import createEmotion from 'create-emotion'

export const {
  flush,
  hydrate,
  cx,
  merge,
  getRegisteredStyles,
  injectGlobal,
  keyframes,
  css,
  sheet,
  cache
} = createEmotion({
  // The key option is required when there will be multiple instances in a single app
  key: 'some-key'
})

Options

createEmotion accepts the same options as createCache from @emotion/cache.

Current Tags

  • 11.0.0                                ...           latest (6 years ago)
  • 11.0.0-next.10                                ...           next (7 years ago)
  • 11.0.0-rc.0                                ...           rc (6 years ago)

54 Versions

  • 11.0.0                                ...           6 years ago
  • 11.0.0-rc.0                                ...           6 years ago
  • 11.0.0-next.10                                ...           7 years ago
  • 10.0.27                                ...           7 years ago
  • 11.0.0-next.8                                ...           7 years ago
  • 11.0.0-next.6                                ...           7 years ago
  • 11.0.0-next.3                                ...           7 years ago
  • 11.0.0-next.1                                ...           7 years ago
  • 11.0.0-next.0                                ...           7 years ago
  • 10.0.14                                ...           7 years ago
  • 10.0.9                                ...           8 years ago
  • 10.0.8                                ...           8 years ago
  • 10.0.7                                ...           8 years ago
  • 10.0.6                                ...           8 years ago
  • 10.0.5                                ...           8 years ago
  • 10.0.4                                ...           8 years ago
  • 10.0.3                                ...           8 years ago
  • 10.0.2                                ...           8 years ago
  • 10.0.0                                ...           8 years ago
  • 10.0.0-beta.13                                ...           8 years ago
  • 10.0.0-beta.12                                ...           8 years ago
  • 10.0.0-beta.11                                ...           8 years ago
  • 10.0.0-beta.10                                ...           8 years ago
  • 10.0.0-beta.9                                ...           8 years ago
  • 10.0.0-beta.8                                ...           8 years ago
  • 10.0.0-beta.7                                ...           8 years ago
  • 10.0.0-beta.6                                ...           8 years ago
  • 10.0.0-beta.5                                ...           8 years ago
  • 10.0.0-beta.4                                ...           8 years ago
  • 10.0.0-beta.3                                ...           8 years ago
  • 10.0.0-beta.2                                ...           8 years ago
  • 10.0.0-beta.1                                ...           8 years ago
  • 10.0.0-beta.0                                ...           8 years ago
  • 9.2.12                                ...           8 years ago
  • 9.2.11                                ...           8 years ago
  • 10.0.0-really-unsafe-please-do-not-use.2                                ...           8 years ago
  • 10.0.0-really-unsafe-please-do-not-use.1                                ...           8 years ago
  • 10.0.0-really-unsafe-please-do-not-use.0                                ...           8 years ago
  • 9.2.6                                ...           8 years ago
  • 9.2.5                                ...           8 years ago
  • 9.2.4                                ...           8 years ago
  • 9.2.1                                ...           8 years ago
  • 9.2.0                                ...           8 years ago
  • 9.1.3                                ...           9 years ago
  • 9.1.2                                ...           9 years ago
  • 9.1.1                                ...           9 years ago
  • 9.1.0                                ...           9 years ago
  • 9.0.2                                ...           9 years ago
  • 9.0.1                                ...           9 years ago
  • 9.0.0                                ...           9 years ago
  • 9.0.0-3                                ...           9 years ago
  • 9.0.0-2                                ...           9 years ago
  • 9.0.0-1                                ...           9 years ago
  • 9.0.0-0                                ...           9 years ago
Downloads
Total 183
Today 0
This Week 0
This Month 97
Last Day 5
Last Week 15
Last Month 85
Dependencies (4)
Dev Dependencies (3)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE