Skip to content

Commit

Permalink
perf(fe): use dynamic subset of pretendard (#1706)
Browse files Browse the repository at this point in the history
  • Loading branch information
dotoleeoak authored May 24, 2024
1 parent 650cab3 commit 943584d
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 16 deletions.
12 changes: 2 additions & 10 deletions apps/frontend/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
import { Toaster } from '@/components/ui/sonner'
import { metaBaseUrl } from '@/lib/constants'
import { cn } from '@/lib/utils'
import type { Metadata, Viewport } from 'next'
import { Ubuntu_Mono } from 'next/font/google'
import localFont from 'next/font/local'
import 'pretendard/dist/web/variable/pretendardvariable-dynamic-subset.css'
import './globals.css'

// TODO: 추후에 페이지 별로 revalidate 시간 논의 및 조정 필요
export const revalidate = 5

const pretendard = localFont({
src: './PretendardVariable.woff2',
display: 'swap',
weight: '45 920',
variable: '--font-pretendard'
})

const mono = Ubuntu_Mono({
subsets: ['latin'],
weight: ['400'],
Expand All @@ -42,7 +34,7 @@ export default function RootLayout({
children: React.ReactNode
}) {
return (
<html lang="en" className={cn(pretendard.variable, mono.variable)}>
<html lang="en" className={mono.variable}>
<body>
{children}
<Toaster
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"next": "14.2.3",
"next-auth": "^4.24.7",
"next-themes": "^0.3.0",
"pretendard": "^1.3.9",
"react": "^18.3.1",
"react-day-picker": "^8.10.1",
"react-dom": "^18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default {
editor: '3rem minmax(0, 1fr)'
},
fontFamily: {
sans: ['--font-pretendard', ...defaultTheme.fontFamily.sans],
sans: ['Pretendard Variable', ...defaultTheme.fontFamily.sans],
mono: ['var(--font-mono)', ...defaultTheme.fontFamily.mono]
},
colors: {
Expand Down
122 changes: 117 additions & 5 deletions pnpm-lock.yaml

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

0 comments on commit 943584d

Please sign in to comment.