diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 3ab62fb0..2bf2b134 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -22,7 +22,7 @@ import {
import { getColorScheme } from "~/lib/get-color-scheme"
import { ColorSchemeInjector } from "./ColorSchemeInjector"
-import Providers, { mantineTheme } from "./providers"
+import Providers, { mantineDefaultColorScheme, mantineTheme } from "./providers"
export const metadata: Metadata = {
title: `${APP_NAME} - ${APP_SLOGAN}`,
@@ -118,7 +118,10 @@ export default function RootLayout({
-
+
{modal}
{children}
diff --git a/src/app/providers.tsx b/src/app/providers.tsx
index 184ef389..d5c5e97e 100644
--- a/src/app/providers.tsx
+++ b/src/app/providers.tsx
@@ -41,6 +41,17 @@ export const mantineTheme = createTheme({
fontFamily: "var(--font-fans)",
})
+let mantineDefaultColorSchemeT = "auto"
+if (localStorage.getItem(DARK_MODE_STORAGE_KEY) === "light") {
+ mantineDefaultColorSchemeT = "light"
+} else if (localStorage.getItem(DARK_MODE_STORAGE_KEY) === "dark") {
+ mantineDefaultColorSchemeT = "dark"
+}
+export const mantineDefaultColorScheme = mantineDefaultColorSchemeT as
+ | "auto"
+ | "light"
+ | "dark"
+
const createQueryClient = () => new QueryClient()
export default function Providers({
children,
diff --git a/src/components/common/DarkModeSwitch.tsx b/src/components/common/DarkModeSwitch.tsx
index b966f995..df377155 100644
--- a/src/components/common/DarkModeSwitch.tsx
+++ b/src/components/common/DarkModeSwitch.tsx
@@ -3,6 +3,8 @@
import { useTheme } from "next-themes"
import { MouseEvent } from "react"
+import { useMantineColorScheme } from "@mantine/core"
+
import { useIsClient } from "~/hooks/useClient"
import { cn } from "~/lib/utils"
@@ -33,11 +35,13 @@ const ThemeIndicator = () => {
const ThemeSwitcher = () => {
const { setTheme } = useTheme()
+ const { setColorScheme } = useMantineColorScheme()
const buildThemeTransition = (
e: MouseEvent,
theme: "light" | "dark" | "system",
) => {
+ setColorScheme(theme === "system" ? "auto" : theme)
return setTheme(theme)
// disable in https://github.com/Crossbell-Box/xLog/commit/06713c901e90b57de6f5f5a0252d2c9dd874335f
if (
diff --git a/src/css/tailwind.css b/src/css/tailwind.css
index f53f86ba..ad6d1592 100644
--- a/src/css/tailwind.css
+++ b/src/css/tailwind.css
@@ -4,8 +4,8 @@
@layer base {
body {
- @apply text-zinc-800;
- @apply fill-zinc-800;
+ @apply !text-zinc-800;
+ @apply !fill-zinc-800;
font-family: var(--font-fans);
}