fix: move back to old theming

This commit is contained in:
iCrawl
2022-11-30 04:34:47 +01:00
parent 8a39c14921
commit 2cb1000a3a
2 changed files with 38 additions and 15 deletions

View File

@@ -1,5 +1,6 @@
import { ServerThemeProvider } from 'next-themes';
// import { ServerThemeProvider } from 'next-themes';
import type { PropsWithChildren } from 'react';
import { Providers } from './providers';
import '@unocss/reset/tailwind.css';
import '../styles/inter.css';
@@ -9,19 +10,21 @@ import '../styles/main.css';
export default function RootLayout({ children }: PropsWithChildren) {
return (
<ServerThemeProvider
attribute="class"
defaultTheme="system"
disableTransitionOnChange
value={{
light: 'light',
dark: 'dark',
}}
>
<html lang="en">
<head />
<body className="dark:bg-dark-800 bg-white">{children}</body>
</html>
</ServerThemeProvider>
// <ServerThemeProvider
// attribute="class"
// defaultTheme="system"
// disableTransitionOnChange
// value={{
// light: 'light',
// dark: 'dark',
// }}
// >
<html lang="en">
<head />
<body className="dark:bg-dark-800 bg-white">
<Providers>{children}</Providers>
</body>
</html>
// </ServerThemeProvider>
);
}

View File

@@ -0,0 +1,20 @@
'use client';
import { ThemeProvider } from 'next-themes';
import type { PropsWithChildren } from 'react';
export function Providers({ children }: PropsWithChildren) {
return (
<ThemeProvider
attribute="class"
defaultTheme="system"
disableTransitionOnChange
value={{
light: 'light',
dark: 'dark',
}}
>
{children}
</ThemeProvider>
);
}