import { useMediaQuery } from '../useMediaQuery' ; export type ColorSchemeType = 'dark' | 'light' ; see https export function usePreferredColorScheme ( ) { const isDark = useMediaQuery ( '(prefers-color-scheme: dark)' ) ; return isDark ? 'dark' : 'light' ; }