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

feat: add option to use Geist Sans instead of Inter #1821

Merged
merged 11 commits into from
May 7, 2024
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
5 changes: 4 additions & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,8 @@
"type-fest": "^3.7.0",
"typescript": "^5.4.2",
"zod": "^3.23.3"
}
},
"trustedDependencies": [
"es5-ext"
kakenbutter marked this conversation as resolved.
Show resolved Hide resolved
]
}
1 change: 1 addition & 0 deletions cli/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ export const runCli = async (): Promise<CliResults> => {
if (project.authentication === "next-auth") packages.push("nextAuth");
if (project.database === "prisma") packages.push("prisma");
if (project.database === "drizzle") packages.push("drizzle");
packages.push("geist");
kakenbutter marked this conversation as resolved.
Show resolved Hide resolved

return {
appName: project.name ?? cliResults.appName,
Expand Down
3 changes: 3 additions & 0 deletions cli/src/installers/dependencyVersionMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@ export const dependencyVersionMap = {
"@tanstack/react-query": "^5.25.0",
superjson: "^2.2.1",
"server-only": "^0.0.1",

// Geist
geist: "^1.3.0",
kakenbutter marked this conversation as resolved.
Show resolved Hide resolved
} as const;
export type AvailableDependencies = keyof typeof dependencyVersionMap;
10 changes: 10 additions & 0 deletions cli/src/installers/geist.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { type Installer } from "~/installers/index.js";
import { addPackageDependency } from "~/utils/addPackageDependency.js";

export const geistInstaller: Installer = ({ projectDir }) => {
kakenbutter marked this conversation as resolved.
Show resolved Hide resolved
addPackageDependency({
projectDir,
dependencies: ["geist"],
devMode: true,
});
};
10 changes: 8 additions & 2 deletions cli/src/installers/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { envVariablesInstaller } from "~/installers/envVars.js";
import { geistInstaller } from "~/installers/geist.js";
import { nextAuthInstaller } from "~/installers/nextAuth.js";
import { prismaInstaller } from "~/installers/prisma.js";
import { tailwindInstaller } from "~/installers/tailwind.js";
Expand All @@ -8,14 +9,15 @@ 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",
"drizzle",
"tailwind",
"trpc",
"geist",
"envVariables",
"eslint",
"dbContainer",
Expand Down Expand Up @@ -74,6 +76,10 @@ export const buildPkgInstallerMap = (
inUse: packages.includes("trpc"),
installer: trpcInstaller,
},
geist: {
inUse: packages.includes("geist"),
installer: geistInstaller,
},
dbContainer: {
inUse: ["mysql", "postgres"].includes(databaseProvider),
installer: dbContainerInstaller,
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"],
kakenbutter marked this conversation as resolved.
Show resolved Hide resolved
};

export default config;
3 changes: 1 addition & 2 deletions cli/template/extras/config/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { type Config } from "tailwindcss";
import { fontFamily } from "tailwindcss/defaultTheme";

export default {
content: ["./src/**/*.tsx"],
theme: {
extend: {
fontFamily: {
sans: ["var(--font-sans)", ...fontFamily.sans],
kakenbutter marked this conversation as resolved.
Show resolved Hide resolved
sans: ["var(--font-geist-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
2 changes: 1 addition & 1 deletion upgrade/src/app/api/og/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,6 @@
});

// Object.fromEntries is typed as returning any *sigh*
// eslint-disable-next-line @typescript-eslint/no-unsafe-return

return Object.fromEntries(await Promise.all(promises));

Check failure on line 135 in upgrade/src/app/api/og/route.tsx

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe return of an `any` typed value
}
2 changes: 1 addition & 1 deletion www/src/components/landingPage/ClipboardSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function ClipboardSelect() {
<div className="flex items-center gap-2">
<Menu as="div">
<div className="relative">
<Menu.Button className="relative flex cursor-pointer items-center justify-center rounded-lg border bg-t3-purple-200/50 p-2 text-left focus:outline-none hover:bg-t3-purple-200/75 dark:border-t3-purple-200/20 dark:bg-t3-purple-200/10 dark:hover:border-t3-purple-200/50 sm:text-sm">
<Menu.Button className="relative flex cursor-pointer items-center justify-center rounded-lg border bg-t3-purple-200/50 p-2 text-left hover:bg-t3-purple-200/75 focus:outline-none dark:border-t3-purple-200/20 dark:bg-t3-purple-200/10 dark:hover:border-t3-purple-200/50 sm:text-sm">
<svg
className={`h-[1em] w-[1em] ${coolDown && "hidden"}`}
xmlns="http://www.w3.org/2000/svg"
Expand Down
Loading
Loading