#Light Mode and Dark Mode...

5 messages · Page 1 of 1 (latest)

gleaming lotus
#

when making a app that uses light mode and dark mode.

  const { colorScheme } = useMantineColorScheme();
  const isDark = colorScheme === "dark";

do i always have to use this and do a ternary operator to change styles? is there a way so that it automatically changes style without is the isDark variable?

edit*
im new to this and i can't find the docs to handle this

gentle talon
gleaming lotus
# gentle talon How else is it supposed to work?

so for example in the docs we have the preview and the code for it right? and if i toggle theme in the docs the ui component automatically changes colors but in the code preview we don't have these const { colorScheme } = useMantineColorScheme(); const isDark = colorScheme === "dark"; or under the hood of the docs code they exist?

#

damn, i like my english 💀

gentle talon