Skip to content

Commit 1d9d013

Browse files
committed
Fix font configuration for proper Geist font display
- Removed legacy @next/font package (not needed in Next.js 15) - Updated layout.tsx to apply font CSS variables to html element - Added font-family declarations to globals.css with proper fallbacks - Improved font rendering with anti-aliasing settings
1 parent 75bc439 commit 1d9d013

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

app/globals.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,27 @@
7777
}
7878
body {
7979
@apply bg-background text-foreground;
80+
font-feature-settings: "liga" on, "clig" on;
81+
-webkit-font-smoothing: antialiased;
82+
-moz-osx-font-smoothing: grayscale;
83+
}
84+
85+
/* Apply font families */
86+
.font-sans {
87+
font-family: var(--font-geist-sans), ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
88+
}
89+
90+
.font-mono {
91+
font-family: var(--font-geist-mono), ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
92+
}
93+
94+
/* Default font for html */
95+
html {
96+
font-family: var(--font-geist-sans), ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
97+
}
98+
99+
/* Code elements should use mono font */
100+
code, kbd, samp, pre {
101+
font-family: var(--font-geist-mono), ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
80102
}
81103
}

app/layout.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ export default function RootLayout({
2525
children: React.ReactNode;
2626
}>) {
2727
return (
28-
<html lang="en">
29-
<body
30-
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
31-
>
28+
<html lang="en" className={`${geistSans.variable} ${geistMono.variable}`}>
29+
<body className="font-sans antialiased">
3230
<SidebarProvider>
3331
<AppSidebar />
3432
<main className="flex-1 overflow-y-auto">

0 commit comments

Comments
 (0)