Skip to content

Commit

Permalink
feat: Disable Chakra's system color subscription for better compatibi…
Browse files Browse the repository at this point in the history
…lity with `next-themes`
  • Loading branch information
pettinarip committed Aug 17, 2024
1 parent 79d2f71 commit 51eb166
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/@chakra-ui/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ import semanticTokens from "./semanticTokens"
const config: ThemeConfig = {
cssVarPrefix: "eth",
initialColorMode: "system",
useSystemColorMode: true,
/**
* Disable Chakra's system color subscription, as it works differently from
* `next-themes` and causes a desync with it.
*
* Chakra will always change the color mode based on the system preference.
* While `next-themes` will only change to the system preference if the user
* has `system` as their active theme.
*/
useSystemColorMode: false,
}

/**
Expand Down

0 comments on commit 51eb166

Please sign in to comment.