import { createGlobalStyle } from 'styled-components'

const GlobalStyle = createGlobalStyle({
	':root': {
		'--color-bg': '#eee',
		'--color-fg': '#333',
		color: 'var(--color-fg, black)',
		backgroundColor: 'var(--color-bg, white)',
		fontFamily: 'system-ui, sans-serif',
	},
	'body': {
		margin: 0,
	},
	'a': {
		color: 'inherit',
	},
	'@media (prefers-color-scheme: dark)': {
		':root': {
			'--color-bg': '#222',
			'--color-fg': '#eee',
			color: 'var(--color-fg, white)',
			backgroundColor: 'var(--color-bg, black)',
		},
	},
})

const MyApp = ({Component, pageProps}) => {
  return (
  	<>
			<GlobalStyle/>
			<Component {...pageProps} />
		</>
	)
}

export default MyApp;
