Skip to content

Commit

Permalink
feat: custom Variant font
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiazom committed Sep 20, 2024
1 parent afec9b1 commit 9b2828c
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 16 deletions.
13 changes: 7 additions & 6 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from "react";
import type { Preview } from "@storybook/react";
import { Darker_Grotesque, Figtree } from "next/font/google";
import { Figtree } from "next/font/google";
import "../src/styles/global.css";
import localFont from "next/font/local";

const darkerGrotesque = Darker_Grotesque({
subsets: ["latin"],
variable: "--font-darkerGrotesque",
const fontRecoleta = localFont({
src: "../../public/recoleta.otf",
variable: "--font-recoleta",
});

const figtree = Figtree({
const fontFigtree = Figtree({
subsets: ["latin"],
weight: "400",
variable: "--font-figtree",
Expand Down Expand Up @@ -41,7 +42,7 @@ const preview: Preview = {
}

return (
<div className={`${figtree.variable} ${darkerGrotesque.variable}`}>
<div className={`${fontFigtree.variable} ${fontRecoleta.variable}`}>
<Story />
</div>
);
Expand Down
Binary file added public/recoleta.otf
Binary file not shown.
14 changes: 8 additions & 6 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Metadata } from "next";
import { Darker_Grotesque, Figtree } from "next/font/google";
import { Figtree } from "next/font/google";
import localFont from "next/font/local";
import { draftMode } from "next/headers";

import { generateMetadataFromSeo } from "src/utils/seo";
Expand All @@ -10,11 +11,12 @@ import { loadQuery } from "studio/lib/store";

import "src/styles/global.css";

const darkerGrotesque = Darker_Grotesque({
subsets: ["latin"],
variable: "--font-darkerGrotesque",
const fontRecoleta = localFont({
src: "../../public/recoleta.otf",
variable: "--font-recoleta",
});
const figtree = Figtree({

const fontFigtree = Figtree({
subsets: ["latin"],
weight: "400",
variable: "--font-figtree",
Expand Down Expand Up @@ -44,7 +46,7 @@ export default async function RootLayout({

return (
<html lang={siteLang}>
<body className={`${figtree.variable} ${darkerGrotesque.variable}`}>
<body className={`${fontFigtree.variable} ${fontRecoleta.variable}`}>
{children}
{draftMode().isEnabled && <LiveVisualEditing />}
</body>
Expand Down
2 changes: 1 addition & 1 deletion src/components/link/link.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
color: var(--primary-white);
cursor: pointer;
text-decoration: none;
font-family: var(--font-darkerGrotesque);
font-family: var(--font-recoleta);
font-size: 2rem;
font-weight: 400;

Expand Down
2 changes: 1 addition & 1 deletion src/components/navigation/footer/footer.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

.whiteColor {
color: var(--primary-white) !important;
font-family: var(--font-darkerGrotesque) !important;
font-family: var(--font-recoleta) !important;
font-size: 2rem !important;
font-weight: 400 !important;
}
1 change: 1 addition & 0 deletions src/components/sections/hero/hero.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
}

.title {
font-weight: 700;
text-align: center;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
padding: 0.5rem;
background-color: var(--primary-white);
color: var(--primary-black);
font-family: var(--font-darkerGrotesque);
font-family: var(--font-recoleta);
align-items: center;
gap: 0.5rem;
border-radius: 0.9375rem;
Expand Down
2 changes: 1 addition & 1 deletion src/components/text/text.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.h3,
.bodySuperLarge {
color: var(--primary-black);
font-family: var(--font-darkerGrotesque);
font-family: var(--font-recoleta);
}

.bodyLarge,
Expand Down

0 comments on commit 9b2828c

Please sign in to comment.