mirror of
https://github.com/better-auth/better-auth.git
synced 2026-07-16 06:02:29 -05:00
docs: centralize font setup (#10256)
This commit is contained in:
@@ -443,9 +443,9 @@
|
||||
--fd-nav-height: 56px;
|
||||
--fd-banner-height: 0px;
|
||||
--fd-tocnav-height: 0px;
|
||||
--font-sans: Geist, sans-serif;
|
||||
--font-sans: var(--font-geist-sans, Geist, sans-serif);
|
||||
--font-serif: Georgia, serif;
|
||||
--font-mono: Geist Mono, monospace;
|
||||
--font-mono: var(--font-geist-mono, Geist Mono, monospace);
|
||||
--shadow-2xs: 0px 1px 2px 0px hsl(0 0% 0% / 0.09);
|
||||
--shadow-xs: 0px 1px 2px 0px hsl(0 0% 0% / 0.09);
|
||||
--shadow-sm:
|
||||
@@ -522,6 +522,8 @@
|
||||
|
||||
@theme inline {
|
||||
--breakpoint-navbar: 64rem;
|
||||
--font-sans: var(--font-geist-sans, Geist, sans-serif);
|
||||
--font-mono: var(--font-geist-mono, Geist Mono, monospace);
|
||||
--color-background: var(--background);
|
||||
--color-foreground: var(--foreground);
|
||||
--color-card: var(--card);
|
||||
@@ -602,7 +604,7 @@
|
||||
}
|
||||
|
||||
body {
|
||||
@apply overscroll-none bg-background text-foreground selection:bg-foreground selection:text-background;
|
||||
@apply overscroll-none bg-background font-sans text-foreground selection:bg-foreground selection:text-background;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { GeistPixelSquare } from "geist/font/pixel";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import { Analytics } from "@vercel/analytics/next";
|
||||
import type { Metadata } from "next";
|
||||
@@ -7,17 +5,9 @@ import Script from "next/script";
|
||||
import type { ReactNode } from "react";
|
||||
import { StaggeredNavFiles } from "@/components/landing/staggered-nav-files";
|
||||
import { Providers } from "@/components/providers";
|
||||
import { fontVariables } from "@/lib/fonts";
|
||||
import { createMetadata } from "@/lib/metadata";
|
||||
|
||||
const fontSans = Geist({
|
||||
subsets: ["latin"],
|
||||
variable: "--font-sans",
|
||||
});
|
||||
|
||||
const fontMono = Geist_Mono({
|
||||
subsets: ["latin"],
|
||||
variable: "--font-mono",
|
||||
});
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export const metadata: Metadata = createMetadata({
|
||||
title: {
|
||||
@@ -29,7 +19,12 @@ export const metadata: Metadata = createMetadata({
|
||||
|
||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<html lang="en" suppressHydrationWarning data-scroll-behavior="smooth">
|
||||
<html
|
||||
lang="en"
|
||||
className={cn(fontVariables, "antialiased")}
|
||||
suppressHydrationWarning
|
||||
data-scroll-behavior="smooth"
|
||||
>
|
||||
<head>
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
@@ -62,10 +57,7 @@ export default function RootLayout({ children }: { children: ReactNode }) {
|
||||
/>
|
||||
)}
|
||||
</head>
|
||||
<body
|
||||
className={`${fontSans.variable} ${fontMono.variable} ${GeistPixelSquare.variable} font-sans antialiased`}
|
||||
suppressHydrationWarning
|
||||
>
|
||||
<body suppressHydrationWarning>
|
||||
<Providers>
|
||||
<div className="relative min-h-dvh">
|
||||
<StaggeredNavFiles />
|
||||
|
||||
19
docs/lib/fonts.ts
Normal file
19
docs/lib/fonts.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { GeistPixelSquare } from "geist/font/pixel";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const fontSans = Geist({
|
||||
subsets: ["latin"],
|
||||
variable: "--font-geist-sans",
|
||||
});
|
||||
|
||||
const fontMono = Geist_Mono({
|
||||
subsets: ["latin"],
|
||||
variable: "--font-geist-mono",
|
||||
});
|
||||
|
||||
export const fontVariables = cn(
|
||||
fontSans.variable,
|
||||
fontMono.variable,
|
||||
GeistPixelSquare.variable,
|
||||
);
|
||||
Reference in New Issue
Block a user