How to use the @emotion/serialize.handleInterpolation function in @emotion/serialize

To help you get started, we’ve selected a few @emotion/serialize 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 / next / packages / css / src / index.js View on Github external
function css(
  strings: Interpolation | string[],
  ...interpolations: Interpolation[]
): ScopedInsertableStyles {
  let stringMode = true
  let styles: string = ''
  let identifierName = ''

  if (strings == null || strings.raw === undefined) {
    stringMode = false
    styles += handleInterpolation(fakeRegisteredCache, strings)
  } else {
    styles += strings[0]
  }

  interpolations.forEach(function(interpolation, i) {
    styles += handleInterpolation(fakeRegisteredCache, interpolation)
    if (stringMode === true && strings[i + 1] !== undefined) {
      styles += strings[i + 1]
    }
  }, this)
  styles = styles.replace(labelPattern, (match, p1: string) => {
    identifierName += `-${p1}`
    return ''
  })
  let name = hashString(styles) + identifierName
github emotion-js / next / packages / css / src / index.js View on Github external
interpolations.forEach(function(interpolation, i) {
    styles += handleInterpolation(fakeRegisteredCache, interpolation)
    if (stringMode === true && strings[i + 1] !== undefined) {
      styles += strings[i + 1]
    }
  }, this)
  styles = styles.replace(labelPattern, (match, p1: string) => {

@emotion/serialize

serialization utils for emotion

MIT
Latest version published 2 days ago

Package Health Score

84 / 100
Full package analysis

Similar packages