Skip to content

Commit

Permalink
Merge pull request #61 from skovhus/use-next-fonts
Browse files Browse the repository at this point in the history
Load fonts using next
  • Loading branch information
skovhus authored Nov 13, 2023
2 parents 81f7df5 + b43efec commit 2e95ec0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 27 deletions.
8 changes: 1 addition & 7 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ html {
body {
margin: 0;
color: var(--color-text-body);
font-family: 'Merriweather', 'Georgia', serif;
font-weight: 300;
word-wrap: break-word;
font-kerning: normal;
Expand Down Expand Up @@ -367,7 +366,7 @@ h1 {
padding-top: 0;
margin-bottom: 1.75rem;
color: inherit;
font-family: Montserrat, sans-serif;
font-family: var(--font-montserrat);
font-weight: 300;
text-rendering: optimizeLegibility;
font-size: 2rem;
Expand All @@ -383,7 +382,6 @@ h2 {
padding-top: 0;
margin-bottom: 1.75rem;
color: inherit;
font-family: 'Merriweather', 'Georgia', serif;
font-weight: 300;
text-rendering: optimizeLegibility;
font-size: 1.6rem;
Expand All @@ -399,7 +397,6 @@ h3 {
padding-top: 0;
margin-bottom: 1.75rem;
color: inherit;
font-family: 'Merriweather', 'Georgia', serif;
font-weight: 300;
text-rendering: optimizeLegibility;
font-size: 1.4427rem;
Expand All @@ -415,7 +412,6 @@ h4 {
padding-top: 0;
margin-bottom: 1.75rem;
color: inherit;
font-family: 'Merriweather', 'Georgia', serif;
font-weight: 300;
text-rendering: optimizeLegibility;
font-size: 1rem;
Expand All @@ -433,7 +429,6 @@ h5 {
padding-top: 0;
margin-bottom: 1.75rem;
color: inherit;
font-family: 'Merriweather', 'Georgia', serif;
font-weight: 300;
text-rendering: optimizeLegibility;
font-size: 0.83255rem;
Expand All @@ -449,7 +444,6 @@ h6 {
padding-top: 0;
margin-bottom: 1.75rem;
color: inherit;
font-family: 'Merriweather', 'Georgia', serif;
font-weight: 300;
text-rendering: optimizeLegibility;
font-size: 0.75966rem;
Expand Down
19 changes: 16 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'typeface-merriweather'
import 'typeface-montserrat'
import './globals.css'

import { Merriweather, Montserrat } from 'next/font/google'
import Script from 'next/script'
import { Suspense } from 'react'

Expand All @@ -11,13 +10,27 @@ import { NavigationTracking } from '../components/NavigationTracking'
import { getBaseMetadata } from '../lib/constants'
import styles from './layout.module.css'

const merriweather = Merriweather({
subsets: ['latin'],
style: ['normal', 'italic'],
weight: ['300'],
})

const montserrat = Montserrat({
subsets: ['latin'],
weight: ['300'],
variable: '--font-montserrat',
})

export const metadata = getBaseMetadata()

export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
<main className={styles.main}>
<main
className={`${styles.main} ${merriweather.className} ${montserrat.variable}`}
>
<Header />
<section>{children}</section>
<Footer />
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
"rehype-figure": "^1.0.1",
"rehype-pretty-code": "^0.10.2",
"rehype-slug": "^6.0.0",
"shiki": "^0.14.5",
"typeface-merriweather": "^1.1.13",
"typeface-montserrat": "^1.1.13"
"shiki": "^0.14.5"
},
"devDependencies": {
"@types/node": "^20.1.1",
Expand Down
14 changes: 0 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit 2e95ec0

@vercel
Copy link

@vercel vercel bot commented on 2e95ec0 Nov 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.