Skip to content

Commit

Permalink
feat: add next-themes
Browse files Browse the repository at this point in the history
  • Loading branch information
CaliCastle committed Dec 6, 2022
1 parent ba6a77a commit a011173
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 11 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"eslint-config-next": "13.0.6",
"next": "13.0.6",
"next-contentlayer": "^0.2.9",
"next-themes": "^0.2.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"reading-time": "^1.5.0",
Expand Down
25 changes: 14 additions & 11 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,27 @@ import type { AppProps } from 'next/app'
import { sansFont } from '~/lib/font'
import Seo from '~/components/Seo'
import { clsxm } from '@zolplay/utils'
import { ThemeProvider } from 'next-themes'

export default function App({ Component, pageProps }: AppProps) {
return (
<>
<Seo />

<main
className={clsxm(
sansFont.variable,
'relative h-full font-sans',
'bg-primary-900 text-slate-50',
'bg-[url("/grid.svg")] bg-top bg-repeat'
)}
>
<span className="pointer-events-none fixed top-0 block h-[800px] w-full select-none bg-[radial-gradient(103.72%_46.58%_at_50%_0%,rgba(255,255,255,0.09)_0%,rgba(255,255,255,0)_100%)]" />
<ThemeProvider attribute="class">
<main
className={clsxm(
sansFont.variable,
'relative h-full font-sans',
'bg-primary-900 text-slate-50',
'bg-[url("/grid.svg")] bg-top bg-repeat'
)}
>
<span className="pointer-events-none fixed top-0 block h-[800px] w-full select-none bg-[radial-gradient(103.72%_46.58%_at_50%_0%,rgba(255,255,255,0.09)_0%,rgba(255,255,255,0)_100%)]" />

<Component {...pageProps} />
</main>
<Component {...pageProps} />
</main>
</ThemeProvider>
</>
)
}
14 changes: 14 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { fontFamily } = require('tailwindcss/defaultTheme')

/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: 'class',
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
Expand Down

0 comments on commit a011173

Please sign in to comment.