Skip to content

Commit

Permalink
feat: add option to use Geist Sans instead of Inter (#1821)
Browse files Browse the repository at this point in the history
Co-authored-by: Ethan Zhou <ethanzhou@Ethans-MacBook-Pro.local>
Co-authored-by: juliusmarminge <julius0216@outlook.com>
  • Loading branch information
3 people authored May 7, 2024
1 parent 0362924 commit 4de1927
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 82 deletions.
5 changes: 5 additions & 0 deletions .changeset/curly-windows-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-t3-app": minor
---

change default font from Inter to Geist Sans
4 changes: 2 additions & 2 deletions cli/src/installers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { dbContainerInstaller } from "./dbContainer.js";
import { drizzleInstaller } from "./drizzle.js";
import { dynamicEslintInstaller } from "./eslint.js";

// Turning this into a const allows the list to be iterated over for programatically creating prompt options
// Should increase extensability in the future
// Turning this into a const allows the list to be iterated over for programmatically creating prompt options
// Should increase extensibility in the future
export const availablePackages = [
"nextAuth",
"prisma",
Expand Down
1 change: 1 addition & 0 deletions cli/template/base/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const config = {
locales: ["en"],
defaultLocale: "en",
},
transpilePackages: ["geist"],
};

export default config;
1 change: 1 addition & 0 deletions cli/template/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"@t3-oss/env-nextjs": "^0.10.1",
"geist": "^1.3.0",
"next": "^14.2.1",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion cli/template/extras/config/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
theme: {
extend: {
fontFamily: {
sans: ["var(--font-sans)", ...fontFamily.sans],
sans: ["var(--font-geist-sans)", ...fontFamily.sans],
},
},
},
Expand Down
8 changes: 2 additions & 6 deletions cli/template/extras/src/app/layout/base.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import "~/styles/globals.css";

import { Inter } from "next/font/google";

const inter = Inter({
subsets: ["latin"],
});
import { GeistSans } from "geist/font/sans";

export const metadata = {
title: "Create T3 App",
Expand All @@ -19,7 +15,7 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<body className={GeistSans.className}>{children}</body>
</html>
);
}
11 changes: 3 additions & 8 deletions cli/template/extras/src/app/layout/with-trpc-tw.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import "~/styles/globals.css";

import { Inter } from "next/font/google";
import { GeistSans } from "geist/font/sans";

import { TRPCReactProvider } from "~/trpc/react";

const inter = Inter({
subsets: ["latin"],
variable: "--font-sans",
});

export const metadata = {
title: "Create T3 App",
description: "Generated by create-t3-app",
Expand All @@ -21,8 +16,8 @@ export default function RootLayout({
children: React.ReactNode;
}) {
return (
<html lang="en">
<body className={`font-sans ${inter.variable}`}>
<html lang="en" className={`${GeistSans.variable}`}>
<body>
<TRPCReactProvider>{children}</TRPCReactProvider>
</body>
</html>
Expand Down
8 changes: 2 additions & 6 deletions cli/template/extras/src/app/layout/with-trpc.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import "~/styles/globals.css";

import { Inter } from "next/font/google";
import { GeistSans } from "geist/font/sans";

import { TRPCReactProvider } from "~/trpc/react";

const inter = Inter({
subsets: ["latin"],
});

export const metadata = {
title: "Create T3 App",
description: "Generated by create-t3-app",
Expand All @@ -21,7 +17,7 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<body className={inter.className}>
<body className={GeistSans.className}>
<TRPCReactProvider>{children}</TRPCReactProvider>
</body>
</html>
Expand Down
11 changes: 3 additions & 8 deletions cli/template/extras/src/app/layout/with-tw.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import "~/styles/globals.css";

import { Inter } from "next/font/google";

const inter = Inter({
subsets: ["latin"],
variable: "--font-sans",
});
import { GeistSans } from "geist/font/sans";

export const metadata = {
title: "Create T3 App",
Expand All @@ -19,8 +14,8 @@ export default function RootLayout({
children: React.ReactNode;
}) {
return (
<html lang="en">
<body className={`font-sans ${inter.variable}`}>{children}</body>
<html lang="en" className={`${GeistSans.variable}`}>
<body>{children}</body>
</html>
);
}
8 changes: 2 additions & 6 deletions cli/template/extras/src/pages/_app/base.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import { GeistSans } from "geist/font/sans";
import { type AppType } from "next/dist/shared/lib/utils";
import { Inter } from "next/font/google";

import "~/styles/globals.css";

const inter = Inter({
subsets: ["latin"],
});

const MyApp: AppType = ({ Component, pageProps }) => {
return (
<main className={inter.className}>
<main className={GeistSans.className}>
<Component {...pageProps} />
</main>
);
Expand Down
9 changes: 2 additions & 7 deletions cli/template/extras/src/pages/_app/with-auth-trpc-tw.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
import { GeistSans } from "geist/font/sans";
import { type Session } from "next-auth";
import { SessionProvider } from "next-auth/react";
import { type AppType } from "next/app";
import { Inter } from "next/font/google";

import { api } from "~/utils/api";

import "~/styles/globals.css";

const inter = Inter({
subsets: ["latin"],
variable: "--font-sans",
});

const MyApp: AppType<{ session: Session | null }> = ({
Component,
pageProps: { session, ...pageProps },
}) => {
return (
<SessionProvider session={session}>
<main className={`font-sans ${inter.variable}`}>
<main className={GeistSans.className}>
<Component {...pageProps} />
</main>
</SessionProvider>
Expand Down
8 changes: 2 additions & 6 deletions cli/template/extras/src/pages/_app/with-auth-trpc.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
import { GeistSans } from "geist/font/sans";
import { type Session } from "next-auth";
import { SessionProvider } from "next-auth/react";
import { type AppType } from "next/app";
import { Inter } from "next/font/google";

import { api } from "~/utils/api";

import "~/styles/globals.css";

const inter = Inter({
subsets: ["latin"],
});

const MyApp: AppType<{ session: Session | null }> = ({
Component,
pageProps: { session, ...pageProps },
}) => {
return (
<SessionProvider session={session}>
<main className={inter.className}>
<main className={GeistSans.className}>
<Component {...pageProps} />
</main>
</SessionProvider>
Expand Down
9 changes: 2 additions & 7 deletions cli/template/extras/src/pages/_app/with-auth-tw.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
import { GeistSans } from "geist/font/sans";
import { type Session } from "next-auth";
import { SessionProvider } from "next-auth/react";
import { type AppType } from "next/app";
import { Inter } from "next/font/google";

import "~/styles/globals.css";

const inter = Inter({
subsets: ["latin"],
variable: "--font-sans",
});

const MyApp: AppType<{ session: Session | null }> = ({
Component,
pageProps: { session, ...pageProps },
}) => {
return (
<SessionProvider session={session}>
<main className={`font-sans ${inter.variable}`}>
<main className={GeistSans.className}>
<Component {...pageProps} />
</main>
</SessionProvider>
Expand Down
8 changes: 2 additions & 6 deletions cli/template/extras/src/pages/_app/with-auth.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
import { GeistSans } from "geist/font/sans";
import { type Session } from "next-auth";
import { SessionProvider } from "next-auth/react";
import { type AppType } from "next/app";
import { Inter } from "next/font/google";

import "~/styles/globals.css";

const inter = Inter({
subsets: ["latin"],
});

const MyApp: AppType<{ session: Session | null }> = ({
Component,
pageProps: { session, ...pageProps },
}) => {
return (
<SessionProvider session={session}>
<main className={inter.className}>
<main className={GeistSans.className}>
<Component {...pageProps} />
</main>
</SessionProvider>
Expand Down
8 changes: 2 additions & 6 deletions cli/template/extras/src/pages/_app/with-trpc-tw.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import { GeistSans } from "geist/font/sans";
import { type AppType } from "next/app";
import { Inter } from "next/font/google";

import { api } from "~/utils/api";

import "~/styles/globals.css";

const inter = Inter({
subsets: ["latin"],
variable: "--font-sans",
});
const MyApp: AppType = ({ Component, pageProps }) => {
return (
<main className={`font-sans ${inter.variable}`}>
<main className={GeistSans.className}>
<Component {...pageProps} />
</main>
);
Expand Down
8 changes: 2 additions & 6 deletions cli/template/extras/src/pages/_app/with-trpc.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import { GeistSans } from "geist/font/sans";
import { type AppType } from "next/app";
import { Inter } from "next/font/google";

import { api } from "~/utils/api";

import "~/styles/globals.css";

const inter = Inter({
subsets: ["latin"],
});

const MyApp: AppType = ({ Component, pageProps }) => {
return (
<main className={inter.className}>
<main className={GeistSans.className}>
<Component {...pageProps} />
</main>
);
Expand Down
9 changes: 2 additions & 7 deletions cli/template/extras/src/pages/_app/with-tw.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import { GeistSans } from "geist/font/sans";
import { type AppType } from "next/app";
import { Inter } from "next/font/google";

import "~/styles/globals.css";

const inter = Inter({
subsets: ["latin"],
variable: "--font-sans",
});

const MyApp: AppType = ({ Component, pageProps }) => {
return (
<main className={`font-sans ${inter.variable}`}>
<main className={GeistSans.className}>
<Component {...pageProps} />
</main>
);
Expand Down

0 comments on commit 4de1927

Please sign in to comment.