Skip to content

[CHORE] 디자인 시스템 토큰(Color/Typography/Spacing/Radius) 추가 - #11

Open
cchanmi wants to merge 7 commits into
developfrom
chore/design-system
Open

[CHORE] 디자인 시스템 토큰(Color/Typography/Spacing/Radius) 추가#11
cchanmi wants to merge 7 commits into
developfrom
chore/design-system

Conversation

@cchanmi

@cchanmi cchanmi commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Describe

Figma에서 전달받은 Color / Typography / Spacing / Radius 값들을 iOS 코드로 옮기는 작업입니다.

Works made

  • Spacing / Radius: GAMSS/Sources/Core/DesignSystem/Spacing.swift, Radius.swiftCGFloat 상수로 정의
  • Color: GAMSS/Resources/Assets.xcassets/Colors/ 아래 23개 Color Set(Base/Gray/Chromatic/Semantic) 추가, Color+GAMSS.swiftColor.colorWhite, Color.colorGray500 등 피그마 설정된 이름 그대로 노출. Gray 13단계·Semantic 2종·Chromatic 중 green만 라이트/다크 값이 달라 Color Set의 Any/Dark Appearance로 시스템 다크모드에 자동 대응하게 구성. 모든 토큰에 color 접두사를 붙여 SwiftUI 내장 Color.white/.red/.pink 등과의 네이밍 충돌을 피함
  • Typography: Pretendard 4종 폰트(Regular/Medium/SemiBold/Bold) 파일을 공식 GitHub 릴리즈에서 받아 추가하고 Info.plist에 등록, PostScript 이름을 매핑하는 FontWeight enum 추가. Typography enum(30개 스케일: Display/Title/Subtitle/BodyMedium/BodyRegular/Paragraph/Caption)에 fontSize/letterSpacing/lineHeight/weight를 정의하고, .typography(_:) 뷰 모디파이어로 한 번에 적용 가능하게 구성
  • Xcode 16 동기화 그룹이 아닌 GAMSSTests/에 새 테스트 파일을 추가하며 project.pbxproj를 수동으로 함께 수정

Changes Made

UI 변경 없음(토큰 정의만 추가, 기존 화면 미적용). 스크린샷 생략합니다.

How to Test

xcodebuild test -workspace GAMSS.xcworkspace -scheme GAMSS -destination 'platform=iOS Simulator,name=iPhone 17'

전체 30개 테스트(Spacing/Radius/Color/FontWeight/Typography) 통과 확인.

Additional context

  • Figma 원본에서 typography-lineHeight-020이라는 존재하지 않는 값이 적혀 있어서 일단은 임의로 14px(=lineHeight-025)로 확정했습니다.
  • 커스텀 폰트는 SwiftUI .fontWeight()로 굵기 전환이 되지 않아 웨이트별 PostScript 이름을 직접 매핑했습니다.

References

@dlrjswns dlrjswns left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

수고많으셨습니다 !! p1부분 확인부탁드립니다
디자인시스템넣느라 고생많으셨습니다 :)

content
.font(.custom(metrics.weight.postScriptName, size: metrics.fontSize))
.tracking(metrics.letterSpacing)
.lineSpacing(metrics.lineHeight - metrics.fontSize)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

p1
lineHeight - fontSize는 Typography의 규칙이라 TypographyModifier보다는 Metrics 내부에서 계산하도록 하는게 좋아보여요

Suggested change
.lineSpacing(metrics.lineHeight - metrics.fontSize)
var lineSpacing: CGFloat {
lineHeight - fontSize
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

반영했습니다. lineSpacing 계산을 Metrics.lineSpacing 계산 프로퍼티로 옮겼습니다 (f2c4644).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@cchanmi 고생하셨습니다 !!

Comment on lines +1 to +12
enum FontWeight: Hashable {
case regular, medium, semiBold, bold

var postScriptName: String {
switch self {
case .regular: "Pretendard-Regular"
case .medium: "Pretendard-Medium"
case .semiBold: "Pretendard-SemiBold"
case .bold: "Pretendard-Bold"
}
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

개인적으로 이 구조가 추후에 다른 커스텀 폰트로 변경될 상황을 생각해보면 폰트 패밀리랑 Weight를 분리해서 관리하는 방식도 고려해보면 좋을꺼같아요 !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants