Skip to content

Commit

Permalink
Merge pull request #83 from now-u/feature/update-font
Browse files Browse the repository at this point in the history
Add pppangram fonts as a git submodule
  • Loading branch information
JElgar authored Nov 8, 2024
2 parents ced5028 + 1db5692 commit f1cd4f1
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/assets/fonts"]
path = src/assets/fonts
url = https://github.com/now-u/now-u-fonts.git
39 changes: 27 additions & 12 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { lazy } from "react";
import { Navbar } from "@/components/Navbar";
import "./globals.css";

import { Nunito, Nunito_Sans } from "next/font/google";
import localFont from "next/font/local";
import { Footer } from "@/components/Footer";
import { getRequiredEnvironmentVariable } from "@/utils/getRequiredEnvironmentVariable";
import { Toaster } from "@/components/ui/toaster";
Expand All @@ -14,24 +14,39 @@ const GA_TAG = getRequiredEnvironmentVariable("GA_TAG_ID");
const GTAG_TAG = getRequiredEnvironmentVariable("GTAG_TAG_ID");
const AW_TAG = getRequiredEnvironmentVariable("AW_TAG_ID");

const nunito = Nunito({
subsets: ["latin"],
variable: "--font-nunito",
});

const nunitoSans = Nunito_Sans({
subsets: ["latin"],
variable: "--font-nunito-sans",
weight: ["400"],
});
const ppPangram = localFont({
src: [
{
path: '../assets/fonts/PPPangramSansRounded-Regular/PPPangramSansRounded-Regular.woff2',
weight: '400',
style: 'normal'
},
{
path: '../assets/fonts/PPPangramSansRounded-Medium/PPPangramSansRounded-Medium.woff2',
weight: '500',
style: 'normal'
},
{
path: '../assets/fonts/PPPangramSansRounded-Semibold/PPPangramSansRounded-Semibold.woff2',
weight: '600',
style: 'normal'
},
{
path: '../assets/fonts/PPPangramSansRounded-Bold/PPPangramSansRounded-Bold.woff2',
weight: '700',
style: 'normal'
}
],
variable: '--font-pppangram'
})

interface RootLayoutProps {
children: React.ReactNode;
}

export default function RootLayout({ children }: RootLayoutProps): JSX.Element {
return (
<html className={`${nunito.variable} ${nunitoSans.variable} font-sans`}>
<html className={`${ppPangram.className}`}>
<Analytics gaId={GA_TAG} gtmId={GTAG_TAG} analyticsTag={AW_TAG} />
<body>
<ScrollHack />
Expand Down
1 change: 1 addition & 0 deletions src/assets/fonts
Submodule fonts added at 9e183a
6 changes: 3 additions & 3 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ module.exports = {
"accordion-up": "accordion-up 0.2s ease-out",
},
fontFamily: {
sans: ["var(--font-nunito-sans)"],
heading: ["var(--font-nunito)"],
subheading: ["var(--font-nunito-sans)"],
sans: ["var(--font-pppangram)"],
heading: ["var(--font-pppangram)"],
subheading: ["var(--font-pppangram)"],
},
},
},
Expand Down

0 comments on commit f1cd4f1

Please sign in to comment.