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(shared/system): StyleProps 타입, createRawStyleProps 함수 추가 #156

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

sukvvon
Copy link
Collaborator

@sukvvon sukvvon commented Apr 23, 2024

이슈 번호

작업한 목록을 작성해 주세요

  • StyleProps 타입, createRawStyleProps 함수 추가합니다!

스크린샷

pr 포인트나 궁금한 점을 작성해 주세요

사용법

import { type StyleProps, createRawStyleProps } from '@favolink/system';

export type FlexStyleProps = StyleProps<
  | 'alignItems'
  | 'flexBasis'
  | 'flexDirection'
  | 'flexGrow'
  | 'flexShrink'
  | 'flexWrap'
  | 'justifyContent'
>;

export const flexStyleProps = createRawStyleProps<FlexStyleProps>(
  'alignItems',
  'flexBasis',
  'flexDirection',
  'flexGrow',
  'flexShrink',
  'flexWrap',
  'justifyContent',
);

flex에 대한 style prop들을 정의하고자 할 경우 위와 같이 사용할 수 있습니다!

image
image

타입은 위와 같이 정의됩니다!
flexStyleProps의 타입이 Record로 정의한 이유는 인자 내부에 FlexStyleProps로 정의한 key들이 전부 다 들어가지 않을 수 있기 때문에 혼란을 방지하고자 하였습니다!

@sukvvon sukvvon requested a review from heyman333 as a code owner April 23, 2024 08:59
@sukvvon sukvvon linked an issue Apr 23, 2024 that may be closed by this pull request
2 tasks
Copy link

vercel bot commented Apr 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
favolink-web ✅ Ready (Inspect) Visit Preview Apr 23, 2024 8:59am

@github-actions github-actions bot added the feat 새로운 기능 추가 또는 기존 기능의 확장 label Apr 23, 2024
@sukvvon sukvvon merged commit bafb463 into main Apr 23, 2024
10 checks passed
@sukvvon sukvvon deleted the feat/155 branch April 23, 2024 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat 새로운 기능 추가 또는 기존 기능의 확장
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(shared/system): StyleProps 타입, createRawStyleProps 함수 추가
1 participant