Skip to content

Commit

Permalink
chore: add heading & handwriting fonts
Browse files Browse the repository at this point in the history
Signed-off-by: rajput-hemant <[email protected]>
  • Loading branch information
rajput-hemant committed Dec 7, 2023
1 parent 7989f13 commit 4c10c02
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "@/app/globals.css";
import type { Metadata, Viewport } from "next";

import { siteConfig } from "@/config/site";
import { fontMono, fontSans } from "@/lib/fonts";
import { fontHandwriting, fontHeading, fontMono, fontSans } from "@/lib/fonts";
import { absoluteUrl, cn } from "@/lib/utils";
import { Providers } from "@/components/providers";
import { TailwindIndicator } from "@/components/tailwind-indicator";
Expand Down Expand Up @@ -68,6 +68,8 @@ export default function RootLayout({ children }: React.PropsWithChildren) {
className={cn(
fontSans.variable,
fontMono.variable,
fontHeading.variable,
fontHandwriting.variable,
"min-h-screen scroll-smooth font-sans antialiased"
)}
>
Expand Down
11 changes: 11 additions & 0 deletions lib/fonts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Inter, JetBrains_Mono } from "next/font/google";
import localFont from "next/font/local";

/* -----------------------------------------------------------------------------------------------
* Google Fonts
Expand All @@ -18,4 +19,14 @@ export const fontMono = JetBrains_Mono({
* Local Fonts
* -----------------------------------------------------------------------------------------------*/

export const fontHeading = localFont({
src: "../public/fonts/CalSans-SemiBold.woff",
variable: "--font-heading",
});

export const fontHandwriting = localFont({
src: "../public/fonts/Virgil.woff2",
variable: "--font-handwriting",
});

// ...
Binary file added public/fonts/CalSans-SemiBold.ttf
Binary file not shown.
Binary file added public/fonts/CalSans-SemiBold.woff
Binary file not shown.
Binary file added public/fonts/Virgil.woff2
Binary file not shown.
2 changes: 2 additions & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ const config = {
fontFamily: {
sans: ["var(--font-sans)", ...fontFamily.sans],
mono: ["var(--font-mono)", ...fontFamily.mono],
heading: ["var(--font-heading)", ...fontFamily.sans],
handwriting: ["var(--font-handwriting)", ...fontFamily.sans],
},
keyframes: {
"accordion-down": {
Expand Down

0 comments on commit 4c10c02

Please sign in to comment.