@talves/itui-color-modes

0.3.0-alpha.0 • Public • Published

@talves/itui-color-modes

Adds support for user-controlled color modes

Note: This package is included in the main itui package, and generally should not be used on its own.

npm i @theme-ui/color-modes
import { createThemeProvider } from '@theme-ui/core'
import { createColorModeProvider } from '@theme-ui/color-modes'
import theme from './theme'

export default ({ children, IsolatedContext }) => {
  const { ThemeProvider } = createThemeProvider(
    IsolatedContext
  )
  const { ColorModeProvider } = createColorModeProvider(
    IsolatedContext
  )

  return (
    <ThemeProvider theme={theme}>
      <ColorModeProvider>
        {children}
      </ColorModeProvider>
    </ThemeProvider>
  )
}

API

  • InitializeColorMode
  • createColorModeProvider
    • useColorMode
    • ColorModeProvider

Readme

Keywords

none

Package Sidebar

Install

npm i @talves/itui-color-modes

Weekly Downloads

0

Version

0.3.0-alpha.0

License

MIT

Unpacked Size

73 kB

Total Files

10

Last publish

Collaborators

  • talves