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

CNA: replace geist font from local to google #72618

Merged
merged 2 commits into from
Nov 13, 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
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"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we still define the weight we are using to reduce the size of the font files?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same q: what's the difference between subset and having weight declared?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it based on the docs:

An array of weight values if the font is not a variable google font. It applies to next/font/google only.

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

});
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
Loading