Skip to content

Commit

Permalink
fix: optimize font loading
Browse files Browse the repository at this point in the history
Signed-off-by: Urban Vidovič <[email protected]>
  • Loading branch information
pseudobun committed Jun 18, 2024
1 parent c7c19c4 commit 607d029
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 0 additions & 1 deletion packages/portfolio/src/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import 'https://fonts.googleapis.com/css2?family=Cabin&family=JetBrains + Mono:wght@100&family=Ubuntu:wght@400;700&display=swap';
@tailwind base;
@tailwind components;
@tailwind utilities;
Expand Down
14 changes: 14 additions & 0 deletions packages/portfolio/src/fonts.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { GoTrueAdminApi } from '@supabase/supabase-js';
import localFont from 'next/font/local';

export const portfolioFont = localFont({
Expand All @@ -23,3 +24,16 @@ export const portfolioFont = localFont({
],
style: 'normal',
});

export const monoFont = localFont({
display: 'swap',
fallback: ['monospace'],
preload: true,
src: [
{
path: '../public/fonts/JetBrainsMono.ttf',
style: 'normal',
weight: '400',
},
],
});

0 comments on commit 607d029

Please sign in to comment.