#Darkmode issue?

11 messages · Page 1 of 1 (latest)

rich thicket
#

My MantineProvider has the colorScheme set to dark but the content of the AppShell is still in light mode.

function App({ Component, pageProps }: AppProps) {
  const [opened, setOpened] = React.useState(false);

  return (
    <NavContext.Provider value={{ opened, setOpened }}>
      <MantineProvider theme={{ colorScheme: "dark" }}>
        <Component {...pageProps} />
      </MantineProvider>
    </NavContext.Provider>
  );
}
fathom hazel
rich thicket
#

ah

foggy lantern
#

Nope, it's not in light mode. Look at the sidebar. Like @fathom hazel pointed out, it's your body background-color that's not set.

rich thicket
#

makes sense

fathom hazel
#

90%+ of the time you basically want to have withNormalizeCSS withGlobalStyles set on MantineProvider

#

there are some cases where maybe you want to force external styles to take over where you won't need it

#

but usually it's a good idea to just assign both those props

rich thicket
#

yep

fathom hazel
#

with them off you'll see other issues, like Select having a horizontal scrollbar