-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: pretendard font asset 추가 - font size를 줄이기위해 subset font 사용 * feat: pretendard, monserrat 폰트 모듈 추가 * chore: tailwind.config.js eslint ignore 추가 * feat: tailwind font extend 설정 * feat: tailwind font size extend 설정 * chore: sample typography * feat: tailwind color extend 설정 * feat: icon asset 추가 * chore: @svgr/webpack 설치 * chore: next에서 svg 사용가능하게 설정 * chore: icon asset property 수정 * style: prettier import order assets 폴더 정렬 추가 * feat: svg 모듈 타입 정의 * feat: svg module export * feat: Icon 컴포넌트 구현 * chore: sample icon rendering * refactor: typo theme extend -> component 플러그인으로 정의 * chore: sample text example 수정 * design: icon default color 수정 * fix: 타이포그래피 글꼴 fallback을 가지는 theme extend 값으로 수정 * feat: info icon 추가 * feat: pretendard medium 추가 * feat: typography 정의 디자인에 맞게 수정
- Loading branch information
Showing
24 changed files
with
1,644 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,6 @@ build | |
dist | ||
next-env.d.ts | ||
next.config.js | ||
tailwind.config.js | ||
yarn.lock | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
declare module '*.svg' { | ||
import React from 'react'; | ||
|
||
const ReactComponent: React.FC<React.SVGProps<SVGSVGElement>>; | ||
export default ReactComponent; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
swcMinify: true, | ||
webpack(config) { | ||
config.module.rules.push({ | ||
test: /\.svg$/i, | ||
issuer: /\.[jt]sx?$/, | ||
use: ["@svgr/webpack"] | ||
}); | ||
return config; | ||
} | ||
} | ||
|
||
module.exports = nextConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export { default as Edit } from './edit.svg'; | ||
export { default as Info } from './info.svg'; | ||
export { default as Menu } from './menu.svg'; | ||
export { default as Plus } from './plus.svg'; | ||
export { default as RightArrow } from './right-arrow.svg'; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { SVGProps } from 'react'; | ||
import clsx from 'clsx'; | ||
import * as icons from '@/assets/icons'; | ||
|
||
const RIGHT_ARROW_WIDTH = 40; | ||
const DEFAULT_SIZE = 24; | ||
|
||
type IconType = keyof typeof icons; | ||
|
||
interface Props extends SVGProps<SVGSVGElement> { | ||
iconType: IconType; | ||
} | ||
|
||
export function Icon({ | ||
iconType, | ||
color, | ||
width = iconType === 'RightArrow' ? RIGHT_ARROW_WIDTH : DEFAULT_SIZE, | ||
height = DEFAULT_SIZE, | ||
...restProps | ||
}: Props) { | ||
const Icon = icons[iconType]; | ||
|
||
return ( | ||
<Icon | ||
fill={color} | ||
width={width} | ||
height={height} | ||
className={clsx({ 'fill-grayscale-500': !color })} | ||
{...restProps} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Icon } from './Icon'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './icon'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
import type { AppProps } from 'next/app'; | ||
import { montserrat, pretendard } from '@/styles/fonts'; | ||
import '@/styles/globals.css'; | ||
|
||
export default function App({ Component, pageProps }: AppProps) { | ||
return <Component {...pageProps} />; | ||
return ( | ||
<main className={`${pretendard.variable} ${montserrat.variable}`}> | ||
<Component {...pageProps} /> | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,22 @@ | ||
import { Inter } from 'next/font/google'; | ||
|
||
const inter = Inter({ subsets: ['latin'] }); | ||
import { Icon } from '@/components/shared'; | ||
|
||
export default function Home() { | ||
return <main className={inter.className}>main</main>; | ||
return ( | ||
<main> | ||
<p className='text-main-headline'>이건 메인 헤드라인이에요 Pretendard</p> | ||
<p className='text-sub-headline'>이건 서브 헤드라인이에요 Pretendard</p> | ||
<p className='text-body1'>이건 본문1이에요 Pretendard</p> | ||
<p className='text-body2'>이건 본문2이에요 Pretendard</p> | ||
<p className='text-caption'>이건 캡션이에요 Pretendard</p> | ||
<p className='text-button1'>이건 버튼1이에요 Pretendard</p> | ||
<p className='text-button2'>이건 버튼2이에요 Pretendard</p> | ||
<p className='text-accent-eng'>Montserrat accent</p> | ||
<p className='text-body-eng'>Montserrat body</p> | ||
<p className='text-caption-eng'>Montserrat caption</p> | ||
<Icon iconType='Edit' /> | ||
<Icon iconType='Menu' /> | ||
<Icon iconType='Plus' /> | ||
<Icon iconType='RightArrow' /> | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Montserrat } from 'next/font/google'; | ||
import localFont from 'next/font/local'; | ||
|
||
const pretendard = localFont({ | ||
src: [ | ||
{ | ||
path: '../../public/fonts/Pretendard-Regular.subset.woff2', | ||
weight: '400', | ||
}, | ||
{ | ||
path: '../../public/fonts/Pretendard-Medium.subset.woff2', | ||
weight: '500', | ||
}, | ||
{ | ||
path: '../../public/fonts/Pretendard-SemiBold.subset.woff2', | ||
weight: '600', | ||
}, | ||
{ | ||
path: '../../public/fonts/Pretendard-Bold.subset.woff2', | ||
weight: '700', | ||
}, | ||
], | ||
variable: '--font-pretendard', | ||
style: 'normal', | ||
display: 'swap', | ||
}); | ||
|
||
const montserrat = Montserrat({ | ||
variable: '--font-montserrat', | ||
weight: ['400', '600'], | ||
style: 'normal', | ||
display: 'swap', | ||
subsets: ['latin'], | ||
}); | ||
|
||
export { pretendard, montserrat }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.