Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 공용 스타일(폰트,색상), 로컬 폰트 적용 및 기타 오류 해결 #19

Closed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 4 additions & 6 deletions src/styles/GlobalStyles.css.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { globalStyle } from '@vanilla-extract/css';
import { Pretendard } from './pretendardFont.css';

globalStyle('html', {
fontSize: '62.5%',
color: '#19191B', //글자기본색
});
globalStyle('html', { fontSize: '62.5%', color: '#19191B' });

globalStyle('*', {
globalStyle('body *', {
boxSizing: 'border-box',
fontFamily: 'Pretendard',
fontFamily: Pretendard,
});
Comment on lines +6 to 9
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

만들어둔 fontface를 globalStyle의 fontFamily로 적용했습니다!


globalStyle('html, body, div, span, h1, h2, h3, h4, h5, h6, p, a, dl, dt, dd, ol, ul, li, form, label, table, button', {
Expand Down
48 changes: 48 additions & 0 deletions src/styles/pretendardFont.css.ts
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 전역적으로 사용할 수 있는 Pretendard라는 custom fontface를 만든 파일입니다.

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { globalFontFace } from '@vanilla-extract/css';

export const Pretendard = 'GlobalPretendard';

globalFontFace(Pretendard, {
fontWeight: 900,
src: `url('/fonts/Pretendard-Black.woff2') format('woff2')`,
});

globalFontFace(Pretendard, {
fontWeight: 800,
src: `url('/fonts/Pretendard-ExtraBold.woff2') format('woff2')`,
});

globalFontFace(Pretendard, {
fontWeight: 700,
src: `url('/fonts/Pretendard-Bold.woff2') format('woff2')`,
});

globalFontFace(Pretendard, {
fontWeight: 600,
src: `url('/fonts/Pretendard-SemiBold.woff2') format('woff2')`,
});

globalFontFace(Pretendard, {
fontWeight: 500,
src: `url('/fonts/Pretendard-Medium.woff2') format('woff2')`,
});

globalFontFace(Pretendard, {
fontWeight: 400,
src: `url('/fonts/Pretendard-Regular.woff2') format('woff2')`,
});

globalFontFace(Pretendard, {
fontWeight: 300,
src: `url('/fonts/Pretendard-Light.woff2') format('woff2')`,
});

globalFontFace(Pretendard, {
fontWeight: 200,
src: `url('/fonts/Pretendard-ExtraLight.woff2') format('woff2')`,
});

globalFontFace(Pretendard, {
fontWeight: 100,
src: `url('/fonts/Pretendard-Thin.woff2') format('woff2')`,
});