Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve next font integration with tailwind #15

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
"wagmi": "^2.12.17"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"postcss": "^8",
"tailwindcss": "^3.4.1"
"tailwindcss": "^3.4.1",
"typescript": "^5"
}
}
16 changes: 4 additions & 12 deletions apps/client/src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@
@tailwind components;
@tailwind utilities;

/* :root { */
/* --background: #ffffff; */
/* --foreground: #171717; */
/* } */

/* @media (prefers-color-scheme: dark) { */
/* :root { */
/* --background: #0a0a0a; */
/* --foreground: #ededed; */
/* } */
/* } */

@layer base {
a {
@apply hover:underline hover:text-crayola;
Expand All @@ -30,6 +18,10 @@
button:hover {
border-radius: 0.75rem;
}

code {
@apply text-base;
}
}

/* body { */
Expand Down
18 changes: 7 additions & 11 deletions apps/client/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import type { Metadata } from 'next'
import { Teko } from 'next/font/google'
import { Fira_Mono, Teko } from 'next/font/google'
import './globals.css'
import { cookieToInitialState } from '@account-kit/core'
import { Layout } from 'client/c/Layout'
import config from 'client/l/config'
import { alchemyConfig } from 'client/lib/account-kit'
import { Providers } from 'client/p'
import { headers } from 'next/headers'
import type { ReactNode } from 'react'

const teko = Teko({ subsets: ['latin'] })
const firaMono = Fira_Mono({ display: 'swap', subsets: ['latin'], variable: '--font-fira-mono', weight: '400' })
const teko = Teko({ display: 'swap', subsets: ['latin'], variable: '--font-teko' })

export const metadata: Metadata = {
title: 'Rideau',
description: 'Anonymous survey and feedback platform',
}
export const metadata = config.metadata

export default function RootLayout({
children,
Expand All @@ -23,10 +21,8 @@ export default function RootLayout({
const initialState = cookieToInitialState(alchemyConfig, headers().get('cookie') ?? undefined)

return (
<html lang='en'>
<body
className={teko.className}
>
<html className={`${firaMono.variable} ${teko.variable}`} lang='en'>
<body>
{/* @ts-ignore FIXME */}
<Providers initialState={initialState}>
<Layout>
Expand Down
10 changes: 8 additions & 2 deletions apps/client/src/components/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ export const Dashboard = () => {
return (
<div>
<h1>Dashboard</h1>
<p>Account: {account?.address}</p>
{semaphoreId.andThenSync(({ commitment }) => <p>Semaphore commitment: {commitment.toString()}</p>)}
<p>
Account: <code>{account?.address}</code>
</p>
{semaphoreId.andThenSync(({ commitment }) => (
<p>
Semaphore commitment: <code>{commitment.toString()}</code>
</p>
))}
</div>
)
}
7 changes: 7 additions & 0 deletions apps/client/src/lib/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { isEnvVarDefined, sharedConfig, type SharedConfigI } from 'config'
import type { Metadata } from 'next'

interface ClientConfigI {
metadata: Metadata
serverUrl: string
}

Expand All @@ -10,6 +12,11 @@ isEnvVarDefined(serverUrl, 'NEXT_PUBLIC_SERVER_URL')

const clientConfig: SharedConfigI & ClientConfigI = {
...sharedConfig,
metadata: {
title: 'Rideau',
description: 'Anonymous survey and feedback platform',
},

serverUrl,
}

Expand Down
5 changes: 4 additions & 1 deletion apps/client/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { Config } from 'tailwindcss'

const config: Config = {
content: [
'./src/pages/**/*.{js,ts,jsx,tsx,mdx}',
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
'./src/app/**/*.{js,ts,jsx,tsx,mdx}',
],
Expand All @@ -18,6 +17,10 @@ const config: Config = {
blue: '#99e1d9',
wenge: '#5d576b',
},
fontFamily: {
mono: ['var(--font-fira-mono)'],
sans: ['var(--font-teko)'],
},
},
},
plugins: [],
Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5485,7 +5485,7 @@ cli-width@^4.1.0:
"@account-kit/infra" "^4.0.0-beta.9"
"@account-kit/react" "^4.0.0-beta.9"
"@hazae41/option" "^1.1.4"
"@semaphore-protocol/core" ""
"@semaphore-protocol/core" "^4.3.0"
"@tanstack/react-query" "^5.59.8"
"@trpc/client" "^10.45.2"
encoding "^0.1.13"
Expand Down