How to use the @theme-ui/core.Context.Provider function in @theme-ui/core

To help you get started, we’ve selected a few @theme-ui/core 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 system-ui / theme-ui / packages / color-modes / src / index.js View on Github external
const theme = applyColorMode(outer.theme || {}, colorMode)

  if (theme.useCustomProperties !== false) {
    theme.rawColors = {...theme.colors}
    theme.colors = toCustomProperties(theme.colors, 'colors')
  }

  const context = {
    ...outer,
    theme,
    colorMode,
    setColorMode,
  }

  return jsx(EmotionContext.Provider, { value: theme },
    jsx(Context.Provider, { value: context },
      jsx(BodyStyles, { key: 'color-mode' }),
      children
    )
  )
}

@theme-ui/core

[![Minified Size on Bundlephobia](https://badgen.net/bundlephobia/minzip/@theme-ui/core)](https://bundlephobia.com/package/@theme-ui/core)

MIT
Latest version published 2 months ago

Package Health Score

93 / 100
Full package analysis

Similar packages