diff --git a/src/app/fonts/Vazirmatn-variable.woff2 b/src/app/fonts/Vazirmatn-variable.woff2 new file mode 100644 index 0000000..a501289 Binary files /dev/null and b/src/app/fonts/Vazirmatn-variable.woff2 differ diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 800a76e..15814d7 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,10 +1,19 @@ import type { Metadata } from "next"; +import localFont from "next/font/local"; import Navbar from "@/components/Navbar"; import Footer from "@/components/Footer"; import Providers from "@/components/providers"; import { siteUrl } from "@/lib/site"; import "../index.css"; +const vazirmatn = localFont({ + src: "./fonts/Vazirmatn-variable.woff2", + display: "swap", + weight: "100 900", + variable: "--font-vazirmatn", + fallback: ["Tahoma", "Arial", "sans-serif"], +}); + export const metadata: Metadata = { metadataBase: new URL(siteUrl), title: { @@ -22,7 +31,7 @@ export default function RootLayout({ }>) { return ( - + {children} diff --git a/src/index.css b/src/index.css index 50cce50..88fe876 100644 --- a/src/index.css +++ b/src/index.css @@ -2,10 +2,6 @@ @tailwind components; @tailwind utilities; -* { - font-family: 'Vazirmatn', sans-serif; -} - /* Definition of the design system. All colors, gradients, fonts, etc should be defined here. All colors MUST be HSL. */ @@ -104,6 +100,6 @@ All colors MUST be HSL. } body { - @apply bg-background text-foreground; + @apply bg-background font-sans text-foreground; } } diff --git a/tailwind.config.ts b/tailwind.config.ts index d5a6027..66c8761 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -15,7 +15,7 @@ export default { }, extend: { fontFamily: { - sans: ['Vazirmatn', 'sans-serif'], + sans: ["var(--font-vazirmatn)", "Tahoma", "Arial", "sans-serif"], }, colors: { border: "hsl(var(--border))",