From 0fa129d3a59d598166e8e3186f369543c99d6bed Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Wed, 26 Oct 2022 16:21:00 +0300 Subject: [PATCH] [@mantine/styles] Add support for `color-scheme` attribute --- src/mantine-styles/src/theme/GlobalStyles.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mantine-styles/src/theme/GlobalStyles.tsx b/src/mantine-styles/src/theme/GlobalStyles.tsx index 1a93c37dd94..3ee0a7ea8ba 100644 --- a/src/mantine-styles/src/theme/GlobalStyles.tsx +++ b/src/mantine-styles/src/theme/GlobalStyles.tsx @@ -10,6 +10,10 @@ export function GlobalStyles({ theme }: { theme: MantineTheme }) { boxSizing: 'border-box', }, + html: { + colorScheme: theme.colorScheme === 'dark' ? 'dark' : 'light', + }, + body: { ...theme.fn.fontStyles(), backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white,