Use nextjs font loader

This commit is contained in:
Benji Grant 2023-06-09 03:16:18 +10:00
parent c4d47cd034
commit badcbac658
10 changed files with 17 additions and 30 deletions

View file

@ -1,25 +1,3 @@
@font-face {
font-family: 'Karla';
src: url('/fonts/karla-variable.ttf') format('truetype');
font-weight: 200 800;
}
@font-face {
font-family: 'Samurai Bob';
src: url('/fonts/samuraibob.woff2') format('woff2'),
url('/fonts/samuraibob.woff') format('woff');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Molot';
src: url('/fonts/molot.woff2') format('woff2'),
url('/fonts/molot.woff') format('woff');
font-weight: 400;
font-style: normal;
}
:root {
color-scheme: light dark;
@ -85,7 +63,6 @@ html {
body {
margin: 0;
font-family: 'Karla', sans-serif;
background: var(--background);
color: var(--text);
font-weight: var(--font-weight);

View file

@ -1,4 +1,5 @@
import { Metadata } from 'next'
import { Karla } from 'next/font/google'
import Egg from '/src/components/Egg/Egg'
import Settings from '/src/components/Settings/Settings'
@ -8,6 +9,8 @@ import { useTranslation } from '/src/i18n/server'
import './global.css'
const karla = Karla({ subsets: ['latin'] })
export const metadata: Metadata = {
metadataBase: new URL('https://crab.fit'),
title: {
@ -33,7 +36,7 @@ const RootLayout = async ({ children }: { children: React.ReactNode }) => {
const { resolvedLanguage } = await useTranslation([])
return <html lang={resolvedLanguage ?? fallbackLng}>
<body>
<body className={karla.className}>
<Settings />
<Egg />
<TranslateDialog />