Skip to content

Commit 6b22284

Browse files
authored
Add more fonts (#5841)
* Use regular font for body text * Use primary text color for content area * Keep medium font for nav * Add italics * Hook up more fonts
1 parent faa395f commit 6b22284

File tree

4 files changed

+329
-3
lines changed

4 files changed

+329
-3
lines changed

src/components/Layout/Page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ export function Page({children, toc, routeTree, meta, section}: PageProps) {
128128
{/* No fallback UI so need to be careful not to suspend directly inside. */}
129129
<Suspense fallback={null}>
130130
<main className="min-w-0 isolate">
131-
<article className="break-words" key={asPath}>
131+
<article
132+
className="break-words font-normal text-primary dark:text-primary-dark"
133+
key={asPath}>
132134
{content}
133135
</article>
134136
<div

src/components/Seo.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,20 @@ export const Seo = withRouter(
138138
type="font/woff2"
139139
crossOrigin="anonymous"
140140
/>
141+
<link
142+
rel="preload"
143+
href="https://react.dev/fonts/Optimistic_Text_W_Rg.woff2"
144+
as="font"
145+
type="font/woff2"
146+
crossOrigin="anonymous"
147+
/>
148+
<link
149+
rel="preload"
150+
href="https://react.dev/fonts/Optimistic_Text_W_It.woff2"
151+
as="font"
152+
type="font/woff2"
153+
crossOrigin="anonymous"
154+
/>
141155
{children}
142156
</Head>
143157
);

src/pages/_document.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const MyDocument = () => {
99
return (
1010
<Html lang="en">
1111
<Head />
12-
<body className="font-text antialiased text-lg bg-wash dark:bg-wash-dark text-secondary dark:text-secondary-dark leading-base">
12+
<body className="font-text font-medium antialiased text-lg bg-wash dark:bg-wash-dark text-secondary dark:text-secondary-dark leading-base">
1313
<script
1414
dangerouslySetInnerHTML={{
1515
__html: `

0 commit comments

Comments
 (0)