Skip to content

Commit 7785079

Browse files
creilly11235claude
andcommitted
feat(apollo-vertex): load Inter font via next/font and add registry:font item
Inter was declared in theme CSS variables but never actually loaded, causing the browser to fall back to system fonts. Use next/font/google with variable: "--font-sans" following the shadcn pattern, and move font declarations out of theme cssVars into a separate registry:font item so consumers can swap fonts independently. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f0125e7 commit 7785079

2 files changed

Lines changed: 26 additions & 7 deletions

File tree

apps/apollo-vertex/app/layout.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@ import { Head } from "nextra/components";
22
import { getPageMap } from "nextra/page-map";
33
import { Footer, Layout, Navbar } from "nextra-theme-docs";
44
import "nextra-theme-docs/style.css";
5+
import { Inter } from "next/font/google";
56
import Image from "next/image";
67
import type { ReactNode } from "react";
78
import "./globals.css";
89
import { Analytics } from "@vercel/analytics/next";
910
import { ThemeSwitcher } from "./components/theme-switcher";
1011
import { ThemeWrapper } from "./components/theme-wrapper";
1112

13+
const fontSans = Inter({
14+
subsets: ["latin"],
15+
variable: "--font-sans",
16+
});
17+
1218
export const metadata = {
1319
title: {
1420
default: "Apollo Vertex",
@@ -73,6 +79,7 @@ export default async function RootLayout({
7379
<html
7480
lang="en"
7581
dir="ltr"
82+
className={fontSans.variable}
7683
// Suggested by `next-themes` package https://github.com/pacocoursey/next-themes#with-app
7784
suppressHydrationWarning
7885
>

apps/apollo-vertex/registry.json

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@
6464
"color-sidebar-accent": "var(--sidebar-accent)",
6565
"color-sidebar-accent-foreground": "var(--sidebar-accent-foreground)",
6666
"color-sidebar-border": "var(--sidebar-border)",
67-
"color-sidebar-ring": "var(--sidebar-ring)"
67+
"color-sidebar-ring": "var(--sidebar-ring)",
68+
"font-sans": "var(--font-sans)",
69+
"font-serif": "var(--font-serif)",
70+
"font-mono": "var(--font-mono)"
6871
},
6972
"light": {
7073
"background": "oklch(1 0 89.8800)",
@@ -118,9 +121,6 @@
118121
"sidebar-accent-foreground": "oklch(0.1660 0.0283 203.3380)",
119122
"sidebar-border": "oklch(0.9237 0.0133 262.3780)",
120123
"sidebar-ring": "oklch(0.64 0.115 208)",
121-
"font-sans": "Inter, ui-sans-serif, sans-serif, system-ui",
122-
"font-serif": "IBM Plex Serif, ui-serif, serif",
123-
"font-mono": "IBM Plex Mono, ui-monospace, monospace",
124124
"radius": "0.625rem",
125125
"shadow-x": "0",
126126
"shadow-y": "0px",
@@ -207,9 +207,6 @@
207207
"sidebar-accent-foreground": "oklch(0.9525 0.0110 225.9830)",
208208
"sidebar-border": "oklch(0.9525 0.0110 225.9830)",
209209
"sidebar-ring": "oklch(0.69 0.112 207)",
210-
"font-sans": "Inter, ui-sans-serif, sans-serif, system-ui",
211-
"font-serif": "IBM Plex Serif, ui-serif, serif",
212-
"font-mono": "IBM Plex Mono, ui-monospace, monospace",
213210
"radius": "0.625rem",
214211
"shadow-x": "0",
215212
"shadow-y": "0px",
@@ -231,6 +228,20 @@
231228
}
232229
}
233230
},
231+
{
232+
"name": "font-inter",
233+
"type": "registry:font",
234+
"title": "Inter Font",
235+
"description": "Inter font configuration for Apollo Vertex. Sets --font-sans CSS variable.",
236+
"font": {
237+
"family": "Inter",
238+
"provider": "google",
239+
"import": "Inter",
240+
"variable": "--font-sans",
241+
"subsets": ["latin"],
242+
"dependency": "@fontsource-variable/inter"
243+
}
244+
},
234245
{
235246
"name": "accordion",
236247
"type": "registry:ui",
@@ -923,6 +934,7 @@
923934
"@mantine/hooks@^9.0.0"
924935
],
925936
"registryDependencies": [
937+
"font-inter",
926938
"button",
927939
"tooltip",
928940
"avatar",

0 commit comments

Comments
 (0)