Skip to content

Commit

Permalink
fix: move back to old theming
Browse files Browse the repository at this point in the history
  • Loading branch information
iCrawl committed Nov 30, 2022
1 parent 8a39c14 commit 2cb1000
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 15 deletions.
33 changes: 18 additions & 15 deletions apps/website/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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>
);
}
20 changes: 20 additions & 0 deletions apps/website/src/app/providers.tsx
Original file line number Diff line number Diff line change
@@ -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>
);
}

1 comment on commit 2cb1000

@vercel
Copy link

@vercel vercel bot commented on 2cb1000 Nov 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.