Skip to content

Commit 9fac5b9

Browse files
committed
📦 NEW: Integrated public sans font
1 parent e5c1769 commit 9fac5b9

File tree

6 files changed

+44
-11
lines changed

6 files changed

+44
-11
lines changed
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
/** @type {import('next').NextConfig} */
22
module.exports = {
33
reactStrictMode: true,
4-
}
4+
experimental: {
5+
fontLoaders: [
6+
{ loader: "@next/font/google", options: { subsets: ["latin"] } },
7+
],
8+
},
9+
};

‎logo-generator-app/package-lock.json‎

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎logo-generator-app/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"start": "next start"
77
},
88
"dependencies": {
9+
"@next/font": "^13.1.4",
910
"next": "latest",
1011
"react": "18.2.0",
1112
"react-dom": "18.2.0"
Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1-
import '../styles/globals.css'
2-
import type { AppProps } from 'next/app'
1+
import "../styles/globals.css";
2+
import type { AppProps } from "next/app";
3+
import { Public_Sans } from "@next/font/google";
4+
5+
const publicSans = Public_Sans({
6+
subsets: ["latin"],
7+
variable: "--font-public-sans",
8+
});
39

410
function MyApp({ Component, pageProps }: AppProps) {
5-
return <Component {...pageProps} />
11+
return (
12+
<main className={`${publicSans.variable} font-sans`}>
13+
<Component {...pageProps} />
14+
</main>
15+
);
616
}
717

8-
export default MyApp
18+
export default MyApp;

‎logo-generator-app/pages/index.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const Home: NextPage = () => {
1111
</Head>
1212

1313
<main className="flex w-full flex-1 flex-col items-center justify-center px-20 text-center">
14-
<h1 className="text-6xl font-bold">
14+
<h1 className="text-6xl font-bold font-sans">
1515
Welcome to{' '}
1616
<a className="text-blue-600" href="https://nextjs.org">
1717
Next.js!
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1+
const { fontFamily } = require("tailwindcss/defaultTheme");
2+
13
/** @type {import('tailwindcss').Config} */
24
module.exports = {
35
content: [
4-
'./pages/**/*.{js,ts,jsx,tsx}',
5-
'./components/**/*.{js,ts,jsx,tsx}',
6-
'./app/**/*.{js,ts,jsx,tsx}',
6+
"./pages/**/*.{js,ts,jsx,tsx}",
7+
"./components/**/*.{js,ts,jsx,tsx}",
8+
"./app/**/*.{js,ts,jsx,tsx}",
79
],
810
theme: {
9-
extend: {},
11+
extend: {
12+
fontFamily: {
13+
sans: ["var(--font-public-sans)", ...fontFamily.sans],
14+
},
15+
},
1016
},
1117
plugins: [],
12-
}
18+
};

0 commit comments

Comments
 (0)