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

feat: add clsx, twMerge and cva to make css easier #12

Merged
merged 9 commits into from
Jun 13, 2024

Conversation

hee-suh
Copy link
Member

@hee-suh hee-suh commented Jun 8, 2024

Issue Number

#2

Description

구현 내용 및 작업한 내용

  • css를 간편하게 하기 위해 clsx, twMerge, cva를 추가하였습니다.
  • clsx, twMerge를 cn으로 유틸화했습니다.
  • cn을 storybook에 적용해보았습니다.
  • rsc와 ssr에서 cva가 정상 작동하는지 확인하였습니다.

To Reviewers

PR을 볼 때 주의깊게 봐야하거나 말하고 싶은 점

  • cva, cn을 적용한 button.tsx 위주로 보시면 될 것 같습니다.
  • rsc와 ssr에서 css가 정상 작동하는지 테스트하는 김에 Suspense를 추가했습니다.
    따라서 Suspense와 관련된 다음 부분은 주의 깊게 보지 않으셔도 될 것 같습니다.
  • 개발 서버를 실행하면 다음과 같은 화면이 나옵니다.
    스크린샷 2024-06-12 오후 2 57 24
    스크린샷 2024-06-12 오후 2 58 00 스크린샷 2024-06-12 오후 2 58 08 스크린샷 2024-06-12 오후 2 58 21

Checklist

PR 등록 전 확인한 것

  • 올바른 타켓 브랜치를 설정하였는가
  • PR 제목은 포맷과 내용 둘 다 알맞게 작성되었는가 (e.g., feat: add login page)
  • Description에 PR을 구체적으로 설명했는가

Copy link
Member

@poiu694 poiu694 left a comment

Choose a reason for hiding this comment

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

Although cva is a tiny library, it's best to use in a SSR/SSG environment – your user probably doesn't need this JavaScript, especially for static components.

https://cva.style/docs/getting-started/variants#creating-variants 에서 언급한 부분인데 SSR/SSG에 사용하기 좋다고 되어있긴 하네요~!


a regular dependency (dependencies). Since the code is executed at runtime by the consumer. If you use SSR/SSG you could probably prevent this code from running on the client, but it would still run on the server at runtime/build time, respectively.

joe-bell/cva#200 (comment) 요 부분도 discussion에 있어용

but there's no harm in moving that to a server-side/static function if you're concerned

joe-bell/cva#83 (comment)

@hee-suh hee-suh force-pushed the feature/css-utility branch from 2632f48 to 0c61cc3 Compare June 13, 2024 08:33
문제: vscode에서 파일명의 대문자를 소문자로 변경한 후 git에 올렸더니, git에서 case 변경 인식을 못해서 github actions에서 lint error 발생

해결: git mv 커맨드를 이용해 파일명을 대문자에서 소문자로 변경하여 파일명 컨벤션 통일
Copy link
Contributor

@Pridesd Pridesd left a comment

Choose a reason for hiding this comment

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

고생 많이 하셨습니다.
image

Copy link
Member

@poiu694 poiu694 left a comment

Choose a reason for hiding this comment

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

KakaoTalk_Photo_2024-06-13-23-45-01 027

@hee-suh hee-suh merged commit 1e16d5a into main Jun 13, 2024
1 check passed
@hee-suh hee-suh deleted the feature/css-utility branch June 13, 2024 14:47
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.

3 participants