Skip to content

Commit

Permalink
CNA: replace geist font from local to google (vercel#72618)
Browse files Browse the repository at this point in the history
### Why?

As Google Font added Geist, replace the CNA local font
with`next/font/google`. Added `subsets` value as the font will be
preloaded. Removed`weight` value as:

> An array of weight values if the font is not a [variable google
font](https://fonts.google.com/variablefonts). It applies to
next/font/google only.

x-ref: https://nextjs.org/docs/app/api-reference/components/font#subsets
x-ref: https://nextjs.org/docs/app/api-reference/components/font#weight

Closes NDX-462
  • Loading branch information
devjiwonchoi authored Nov 13, 2024
1 parent aaf28ab commit 9f6f631
Show file tree
Hide file tree
Showing 24 changed files with 48 additions and 56 deletions.
Binary file not shown.
Binary file not shown.
13 changes: 6 additions & 7 deletions packages/create-next-app/templates/app-tw/js/app/layout.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import localFont from "next/font/local";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
const geistSans = Geist({
variable: "--font-geist-sans",
weight: "100 900",
subsets: ["latin"],
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",

const geistMono = Geist_Mono({
variable: "--font-geist-mono",
weight: "100 900",
subsets: ["latin"],
});

export const metadata = {
Expand Down
Binary file not shown.
Binary file not shown.
13 changes: 6 additions & 7 deletions packages/create-next-app/templates/app-tw/ts/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import type { Metadata } from "next";
import localFont from "next/font/local";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
const geistSans = Geist({
variable: "--font-geist-sans",
weight: "100 900",
subsets: ["latin"],
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",

const geistMono = Geist_Mono({
variable: "--font-geist-mono",
weight: "100 900",
subsets: ["latin"],
});

export const metadata: Metadata = {
Expand Down
Binary file not shown.
Binary file not shown.
13 changes: 6 additions & 7 deletions packages/create-next-app/templates/app/js/app/layout.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import localFont from "next/font/local";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
const geistSans = Geist({
variable: "--font-geist-sans",
weight: "100 900",
subsets: ["latin"],
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",

const geistMono = Geist_Mono({
variable: "--font-geist-mono",
weight: "100 900",
subsets: ["latin"],
});

export const metadata = {
Expand Down
Binary file not shown.
Binary file not shown.
13 changes: 6 additions & 7 deletions packages/create-next-app/templates/app/ts/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import type { Metadata } from "next";
import localFont from "next/font/local";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
const geistSans = Geist({
variable: "--font-geist-sans",
weight: "100 900",
subsets: ["latin"],
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",

const geistMono = Geist_Mono({
variable: "--font-geist-mono",
weight: "100 900",
subsets: ["latin"],
});

export const metadata: Metadata = {
Expand Down
Binary file not shown.
Binary file not shown.
13 changes: 6 additions & 7 deletions packages/create-next-app/templates/default-tw/js/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import Image from "next/image";
import localFont from "next/font/local";
import { Geist, Geist_Mono } from "next/font/google";

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
const geistSans = Geist({
variable: "--font-geist-sans",
weight: "100 900",
subsets: ["latin"],
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",

const geistMono = Geist_Mono({
variable: "--font-geist-mono",
weight: "100 900",
subsets: ["latin"],
});

export default function Home() {
Expand Down
Binary file not shown.
Binary file not shown.
13 changes: 6 additions & 7 deletions packages/create-next-app/templates/default-tw/ts/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import Image from "next/image";
import localFont from "next/font/local";
import { Geist, Geist_Mono } from "next/font/google";

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
const geistSans = Geist({
variable: "--font-geist-sans",
weight: "100 900",
subsets: ["latin"],
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",

const geistMono = Geist_Mono({
variable: "--font-geist-mono",
weight: "100 900",
subsets: ["latin"],
});

export default function Home() {
Expand Down
Binary file not shown.
Binary file not shown.
13 changes: 6 additions & 7 deletions packages/create-next-app/templates/default/js/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import Head from "next/head";
import Image from "next/image";
import localFont from "next/font/local";
import { Geist, Geist_Mono } from "next/font/google";
import styles from "@/styles/Home.module.css";

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
const geistSans = Geist({
variable: "--font-geist-sans",
weight: "100 900",
subsets: ["latin"],
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",

const geistMono = Geist_Mono({
variable: "--font-geist-mono",
weight: "100 900",
subsets: ["latin"],
});

export default function Home() {
Expand Down
Binary file not shown.
Binary file not shown.
13 changes: 6 additions & 7 deletions packages/create-next-app/templates/default/ts/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import Head from "next/head";
import Image from "next/image";
import localFont from "next/font/local";
import { Geist, Geist_Mono } from "next/font/google";
import styles from "@/styles/Home.module.css";

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
const geistSans = Geist({
variable: "--font-geist-sans",
weight: "100 900",
subsets: ["latin"],
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",

const geistMono = Geist_Mono({
variable: "--font-geist-mono",
weight: "100 900",
subsets: ["latin"],
});

export default function Home() {
Expand Down

0 comments on commit 9f6f631

Please sign in to comment.