pretendard font tailwind css에 적용하기

miin·2024년 12월 18일
0

Skill Collection [view]

목록 보기
19/19

pretendard font tailwind css에 적용하기

  • layout.tsx
export default async function RootLayout({
  children,
  params: { locale },
}: Readonly<{
  children: React.ReactNode;
  params: { locale: string };
}>) {
  
 <html lang={locale} suppressHydrationWarning>
      <head>
        <link
          rel="stylesheet"   href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css"
        />
      </head>
      <body className={`font-pre`} suppressHydrationWarning>
      </body>
    </html>
  • tailwind.config.ts
const config = {
  theme: {
    fontFamily: {
      pretendard: ['Pretendard', 'sans-serif'],
    },
  }
}
  • globals.css
@layer base {
  body {
    @apply bg-background text-foreground font-pretendard;
  }
}

0개의 댓글

관련 채용 정보