JSPM

  • Created
  • Published
  • Downloads 30607
  • Score
    100M100P100Q136253F
  • License MIT

SSR and style extraction tooling for emotion, The Next Generation of CSS-in-JS.

Package Exports

  • create-emotion-server
  • create-emotion-server/dist/index.browser.cjs.js
  • create-emotion-server/dist/index.cjs.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (create-emotion-server) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

create-emotion-server

Create Server-Side-Rendering APIs for emotion instances

create-emotion-styled allows you create various APIs for Server-Side Rendering with instances of emotion. This is only needed if you use a custom instance of emotion from create-emotion and you want to do Server-Side Rendering.

import createEmotionServer from 'create-emotion-server'

import { cache } from 'my-emotion-instance'
// or
import createCache from '@emotion/cache'

let cache = createCache()

export const {
  extractCritical,
  renderStylesToString,
  renderStylesToNodeStream
} = createEmotionServer(cache)

All of emotion's SSR APIs are documented in their own doc.