Skip to content

Commit

Permalink
fix: add font vars
Browse files Browse the repository at this point in the history
  • Loading branch information
fivenp committed Jan 9, 2024
1 parent 7390f51 commit 38e2c14
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Layout } from "@/components/Layout";

import "@/styles/tailwind.css";
import "@/styles/styles.css";
import { beVietnamProFont } from "../lib/fonts";
import { inter, firaSans } from "../lib/fonts";

export const metadata: Metadata = {
title: {
Expand All @@ -23,7 +23,7 @@ export default function RootLayout({
return (
<html
lang="en"
className={clsx("h-full antialiased", beVietnamProFont.variable)}
className={clsx("h-full antialiased", inter.variable, firaSans.variable)}
suppressHydrationWarning
>
<head>
Expand Down
16 changes: 12 additions & 4 deletions src/lib/fonts.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import { Be_Vietnam_Pro } from "next/font/google";
import { Fira_Sans, Inter } from "next/font/google";

export const beVietnamProFont = Be_Vietnam_Pro({
export const inter = Inter({
weight: ["400", "500", "600", "700"],
subsets: ["latin"],
weight: ["300", "400", "500", "600", "700"],
variable: "--font-be-vietnam-pro",
display: "swap",
variable: "--font-inter",
});

export const firaSans = Fira_Sans({
weight: ["400", "500", "600", "700"],
subsets: ["latin"],
display: "swap",
variable: "--font-fira-sans",
});
10 changes: 5 additions & 5 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Config } from "tailwindcss";
const plugin = require("tailwindcss/plugin");

const typographyHeading = () => ({
fontFamily: ["Fira Sans", "sans-serif"],
fontFamily: ["var(--font-fira-sans)", "sans-serif"],
fontStyle: "normal",
fontWeight: "bold",
lineHeight: "120%",
Expand Down Expand Up @@ -156,12 +156,12 @@ export default {
}),
},
fontFamily: {
sans: ["Inter", "sans-serif"],
display: ["Inter", "sans-serif"],
sans: ["var(--font-inter)", "sans-serif"],
display: ["var(--font-inter)", "sans-serif"],

// Zuplo Fonts
base: ["Inter", "sans-serif"],
fancy: ["Fira Sans", "sans-serif"],
base: ["var(--font-inter)", "sans-serif"],
fancy: ["var(--font-fira-sans)", "sans-serif"],
mono: ["Consolas", "Monaco", "Andale Mono", "Ubuntu Mono", "monospace"],
},
letterSpacing: {
Expand Down

0 comments on commit 38e2c14

Please sign in to comment.