default to system color mode

This commit is contained in:
Paul Wackerow 2022-11-16 22:44:20 -08:00
parent e2858c04dc
commit 629ed7c885
No known key found for this signature in database
GPG Key ID: BB63E296FE9CAB8D
3 changed files with 15 additions and 1 deletions

View File

@ -0,0 +1,12 @@
import { type ThemeConfig } from '@chakra-ui/react';
/**
* https://chakra-ui.com/docs/styled-system/color-mode
* initialColorMode: 'system' Will default to users system color mode
* useSystemColorMode=true Color mode will change if user changes their system color mode
* Can be overridden with toggle on site and will persist after refresh
* Choice is stored/managed with local storage
*/
export const config: ThemeConfig = {
initialColorMode: 'system',
useSystemColorMode: true
};

View File

@ -1,4 +1,5 @@
export * from './colors';
export * from './config';
export * from './shadows';
export * from './sizes';
export * from './textStyles';

View File

@ -1,9 +1,10 @@
import { extendTheme } from '@chakra-ui/react';
import { colors, shadows, sizes, textStyles } from './foundations';
import { config, colors, shadows, sizes, textStyles } from './foundations';
import { Button, Link } from './components';
const overrides = {
config,
colors,
components: {
Button,