UNPKG

@anishpras/create-portfolio

Version:

🏗 Personal CLI to bootstrap new portfolio from the given templates.

58 lines (53 loc) 1.42 kB
import React from 'react' import { ChakraProvider, ColorModeProvider, useColorMode } from '@chakra-ui/react' import customTheme from '../styles/theme' import { Global, css } from '@emotion/react' import { prismLightTheme, prismDarkTheme } from '../styles/prism' const GlobalStyle = ({ children }) => { const { colorMode } = useColorMode() return ( <> <Global styles={css` ${colorMode === 'light' ? prismLightTheme : prismDarkTheme}; ::selection { background-color: #90CDF4; color: #fefefe; } ::-moz-selection { background: #ffb7b7; color: #fefefe; } html { min-width: 356px; scroll-behavior: smooth; } #__next { display: flex; flex-direction: column; min-height: 100vh; background: ${colorMode === 'light' ? 'white' : '#171717'}; } `} /> {children} </> ) } function MyApp({ Component, pageProps }) { return ( <ChakraProvider resetCSS theme={customTheme}> <ColorModeProvider options={{ initialColorMode: "light", useSystemColorMode: true, }} > <GlobalStyle> <Component {...pageProps} /> </GlobalStyle> </ColorModeProvider> </ChakraProvider> ) } export default MyApp