@talves/itui-color-modes
v0.3.0-alpha.0
Published
Adds support for user-controlled color modes
Downloads
6
Readme
@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