Skip to content

Commit

Permalink
Apply fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
sangwon090 committed Apr 25, 2024
1 parent efdfca4 commit fb59825
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ColorModeScript, Box, Container } from '@chakra-ui/react'
import theme from '@/utils/theme'
import { Navbar } from '@/app/components/layout/Navbar';
import { Footer } from '@/app/components/layout/Footer';
import Fonts from '@/utils/font';

export const metadata: Metadata = {
title: 'SSUJoon',
Expand All @@ -21,6 +22,7 @@ export default function RootLayout({
<html lang="ko">
<body>
<ColorModeScript initialColorMode={theme.config.initialColorMode}></ColorModeScript>
<Fonts />
<Providers>
<Box minH='100dvh'>
<Navbar />
Expand Down
14 changes: 14 additions & 0 deletions src/utils/font.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use client'

import { Global } from '@emotion/react'

const Fonts = () => (
<Global
styles={`
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard-dynamic-subset.min.css");
@import url("https://cdn.jsdelivr.net/gh/wanteddev/wanted-sans@v1.0.1/packages/wanted-sans/fonts/webfonts/variable/split/WantedSansVariable.min.css");
`}
/>
)

export default Fonts
8 changes: 7 additions & 1 deletion src/utils/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ const config: ThemeConfig = {
useSystemColorMode: true,
}

const theme = extendTheme({ config })
const theme = extendTheme({
config: config,
fonts: {
heading: `'Pretendard', sans-serif`,
body: `'Pretendard', sans-serif`,
}
})

export default theme

0 comments on commit fb59825

Please sign in to comment.