Skip to content

Commit

Permalink
💄 feat(utils/fonts): setup spaceGrotesk and karla fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
ythecombinator committed Jan 16, 2024
1 parent 41d2bf2 commit f511f59
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 75 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@
- [tailwind-merge](https://github.com/dcastil/tailwind-merge)
- [clsx](https://github.com/lukeed/clsx)

### 🔤 Fonts

- [next/font](https://nextjs.org/docs/basic-features/font-optimization)
- [General Sans](https://www.fontshare.com/fonts/general-sans)
- [Recoleta](https://www.myfonts.com/collections/recoleta-font-latinotype)

## Running Locally

> **Warning**
Expand Down
2 changes: 1 addition & 1 deletion src/components/shared/dropdown-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const DropdownMenu: FunctionComponent<DropdownMenuProps> = (props) => {
'radix-side-top:animate-slide-up radix-side-bottom:animate-slide-down',
'w-48 rounded-lg px-1.5 py-1 shadow-md md:w-56',
'bg-white dark:bg-gray-800',
fonts.generalSans.className
fonts.karla.className
)}
>
<DropdownMenuPrimitive.Label className="select-none p-2 text-xs text-gray-700 dark:text-gray-200">
Expand Down
6 changes: 3 additions & 3 deletions src/components/shared/layout-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const LayoutWrapper: FunctionComponent<PropsWithChildren<{}>> = ({ children }) =
<div
className={classNames(
'm-auto max-w-2xl px-4 sm:px-6 xl:max-w-2xl xl:px-0',
fonts.generalSans.className,
fonts.generalSans.variable,
fonts.recoleta.variable
fonts.karla.className,
fonts.karla.variable,
fonts.spaceGrotesk.variable
)}
>
<div className="flex h-screen flex-col justify-between">
Expand Down
6 changes: 3 additions & 3 deletions src/components/shared/typography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Heading1: FunctionComponent<PropsWithChildren<HTMLAttributes<HTMLHeadingEl
<h1
className={classNames(
'text-3xl font-extrabold tracking-tight sm:text-4xl md:text-6xl',
fonts.recoleta.className,
fonts.spaceGrotesk.className,
className
)}
{...props}
Expand All @@ -52,7 +52,7 @@ const Heading2: FunctionComponent<PropsWithChildren<HTMLAttributes<HTMLHeadingEl
<h2
className={classNames(
'font-bold text-2xl md:text-3xl tracking-tight my-4 text-black dark:text-white',
fonts.recoleta.className,
fonts.spaceGrotesk.className,
className
)}
{...props}
Expand All @@ -75,7 +75,7 @@ const Heading3: FunctionComponent<PropsWithChildren<HTMLAttributes<HTMLHeadingEl
<h3
className={classNames(
'mt-8 scroll-m-20 text-xl font-semibold tracking-tight',
fonts.recoleta.className,
fonts.spaceGrotesk.className,
className
)}
{...props}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/cv.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Page: NextPage<PageProps> = ({ work }) => {
<main
className={classNames(
'container relative mx-auto scroll-my-12 overflow-auto p-4 print:p-12 md:p-16',
fonts.generalSans.className
fonts.karla.className
)}
>
<section className="mx-auto w-full max-w-2xl space-y-8 bg-white print:space-y-6">
Expand Down
18 changes: 18 additions & 0 deletions src/utils/fonts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Karla, Space_Grotesk } from 'next/font/google';

const spaceGrotesk = Space_Grotesk({
subsets: ['latin'],
display: 'swap',
variable: '--font-space-grotesk',
});

const karla = Karla({
subsets: ['latin'],
display: 'swap',
variable: '--font-karla',
});

export default {
spaceGrotesk,
karla,
};
Binary file not shown.
Binary file not shown.
Binary file removed src/utils/fonts/Recoleta/Recoleta-Black.woff2
Binary file not shown.
Binary file removed src/utils/fonts/Recoleta/Recoleta-Bold.woff2
Binary file not shown.
Binary file removed src/utils/fonts/Recoleta/Recoleta-Light.woff2
Binary file not shown.
Binary file removed src/utils/fonts/Recoleta/Recoleta-Medium.woff2
Binary file not shown.
Binary file removed src/utils/fonts/Recoleta/Recoleta-Regular.woff2
Binary file not shown.
Binary file removed src/utils/fonts/Recoleta/Recoleta-SemiBold.woff2
Binary file not shown.
Binary file removed src/utils/fonts/Recoleta/Recoleta-Thin.woff2
Binary file not shown.
59 changes: 0 additions & 59 deletions src/utils/fonts/index.ts

This file was deleted.

4 changes: 2 additions & 2 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const config = {
14: '3.5rem',
},
fontFamily: {
body: ['var(--font-general-sans)'],
heading: ['var(--font-recoleta)'],
body: ['var(--font-karla)'],
heading: ['var(--font-space-grotesk)'],
},
backgroundImage: {
'texture-pattern': "url('/img/texture-pattern.svg')",
Expand Down

0 comments on commit f511f59

Please sign in to comment.