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

[FE] setting: styles 관련 초기 세팅 #28

Merged
merged 5 commits into from
Feb 4, 2025

Conversation

zelkovaria
Copy link
Collaborator

이슈번호

요약(개요)

  • style과 관련한 GlobalStyle, theme 및 typography 설정을 했습니다

작업 내용

  • GlobalStyle 세팅
  • theme 설정
  • typography 세팅

집중해서 리뷰해야 하는 부분

max-width나 min-width를 정해두면 좋을 것 같은데 우선 임시로 해놨어요..!! 해당 부분은 개발하면서 이야기하거나 조만간 이야기 해봐도 좋을 것 같아요 :D

기타 전달 사항 및 참고 자료(선택)

Typography 관련 컴포넌트 사용 예시예요! 해당 내용을 포함한 코드 설명 등 자세한 이야기는 노션에 공유해둘게요 🚀

  • Typography로 생성 가능한 컴포넌트 종류는 아래 사진과 같아요(현재 임시 설정이고 구현하면서 바뀌는 값이 있는 경우 수정하면 될 것 같아요!)
    image
  • 사용시에는 컴포넌트를 사용하듯이 불러와주시면 돼요! 아래 사진을 보면 바로 이해하실 것 같아요 👍🏻
    image

Copy link
Collaborator

@chysis chysis left a comment

Choose a reason for hiding this comment

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

만들어주신 TypographyComponent 잘 출력되는 것 확인했습니다! 스타일 세팅이 번거로운 작업이었을 텐데 고생 많으셨어요😊

몇 가지 제안할 부분이 있어서 코멘트 남겼습니다. 확인 부탁드려요!

Comment on lines 23 to 30
<ThemeProvider theme={theme}>
<GlobalStyle />
<StrictMode>
<QueryClientProvider client={queryClient}>
<App />
</QueryClientProvider>
</StrictMode>
</ThemeProvider>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

StrictMode가 최상단에 있고, 그 밑에 ThemeProvider > GlobalStyle, QueryClientProvider를 두는 것은 어떤가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

찾아보니 전체 컴포넌트 트리를 StrictMode로 감싸는 패턴이 더 일반적인 것 같아서 좋아요! 반영해두겠습니당!!

import { createGlobalStyle } from 'styled-components';

const GlobalStyle = createGlobalStyle`
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');
Copy link
Collaborator

Choose a reason for hiding this comment

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

웹 폰트를 index.html이 아닌 GlobalStyle에서 받게 된 이유가 있을까요?

image
styled-component는 런타임에 CSSOM을 사용해서 스타일을 관리하는데, @import 구문은 CSSOM에서 다루기 어려운 방식으로 처리한다고 하네요.

import를 제대로 못 할 수도 있고, layout shift가 발생할 수 있어 최적화 관점에서도 문제가 있을 것 같아요.

index.html에서 link 태그로 다운로드 하는 방법을 제안해봅니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

emotion을 사용할 때는 해당 이슈가 없어서 똑같이 해두고 확인을 못 한 것 같아요 😅 해당 부분도 반영해둘게요!

Copy link
Collaborator

Choose a reason for hiding this comment

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

emotion에서는 문제가 없군요! 수정 사항 확인했습니다 :)

@zelkovaria zelkovaria requested a review from chysis February 4, 2025 13:54
Copy link
Collaborator

@chysis chysis left a comment

Choose a reason for hiding this comment

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

수정 사항 확인했습니다! 고생하셨어요 👍

@zelkovaria zelkovaria merged commit 831968b into main Feb 4, 2025
2 checks passed
@zelkovaria zelkovaria deleted the fe/setting/19-styles-setting branch February 4, 2025 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FE] setting: styles 관련 세팅
2 participants