From 270332d7c4b548c24cea0b00f0a150405b141afe Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Fri, 15 May 2026 19:50:30 +0900 Subject: [PATCH] =?UTF-8?q?feat(theme):=20=EB=94=94=EC=9E=90=EC=9D=B8=20?= =?UTF-8?q?=ED=86=A0=ED=81=B0=EC=9D=84=20=EC=B6=94=EA=B0=80=ED=95=9C?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nFontModifier.swift => FontModifier.swift} | 60 ++++++++++++++++++- SodaLive/Sources/UI/Theme/Color.swift | 34 +++++++++++ SodaLive/Sources/UI/Theme/Radius.swift | 12 ++++ SodaLive/Sources/UI/Theme/Spacing.swift | 20 +++++++ 4 files changed, 123 insertions(+), 3 deletions(-) rename SodaLive/Sources/Extensions/{KoreanFontModifier.swift => FontModifier.swift} (60%) create mode 100644 SodaLive/Sources/UI/Theme/Radius.swift create mode 100644 SodaLive/Sources/UI/Theme/Spacing.swift diff --git a/SodaLive/Sources/Extensions/KoreanFontModifier.swift b/SodaLive/Sources/Extensions/FontModifier.swift similarity index 60% rename from SodaLive/Sources/Extensions/KoreanFontModifier.swift rename to SodaLive/Sources/Extensions/FontModifier.swift index 1362543..896380e 100644 --- a/SodaLive/Sources/Extensions/KoreanFontModifier.swift +++ b/SodaLive/Sources/Extensions/FontModifier.swift @@ -1,5 +1,5 @@ // -// KoreanFontModifier.swift +// FontModifier.swift // SodaLive // // Created by klaus on 1/23/26. @@ -7,6 +7,52 @@ import SwiftUI +enum SodaTypography { + case heading1 + case heading2 + case heading3 + case heading4 + case body1 + case body2 + case body3 + case body4 + case body5 + case body6 + case caption1 + case caption2 + case caption3 + + var size: CGFloat { + switch self { + case .heading1: + return 24 + case .heading2: + return 22 + case .heading3: + return 20 + case .heading4: + return 18 + case .body1, .body2, .body3: + return 16 + case .body4, .body5, .body6: + return 14 + case .caption1, .caption2, .caption3: + return 12 + } + } + + var weight: SwiftUI.Font.Weight { + switch self { + case .heading1, .heading2, .heading3, .heading4, .body1, .body4, .caption1: + return .bold + case .body2, .body5, .caption2: + return .medium + case .body3, .body6, .caption3: + return .regular + } + } +} + private func resolvedLanguageCode(currentLocale: Locale) -> String? { if let raw = UserDefaults.standard.string(forKey: "app.language"), let option = LanguageOption(rawValue: raw), @@ -42,7 +88,7 @@ private func japaneseFontName(for weight: SwiftUI.Font.Weight) -> String { } } -struct KoreanFontModifier: ViewModifier { +struct FontModifier: ViewModifier { @Environment(\.locale) private var locale let size: CGFloat let weight: SwiftUI.Font.Weight @@ -63,7 +109,11 @@ struct KoreanFontModifier: ViewModifier { extension View { func appFont(size: CGFloat, weight: SwiftUI.Font.Weight = .regular) -> some View { - self.modifier(KoreanFontModifier(size: size, weight: weight)) + self.modifier(FontModifier(size: size, weight: weight)) + } + + func appFont(_ typography: SodaTypography) -> some View { + appFont(size: typography.size, weight: typography.weight) } } @@ -79,4 +129,8 @@ extension Text { return self.font(.system(size: size, weight: weight)) } + + func appFont(_ typography: SodaTypography) -> Text { + appFont(size: typography.size, weight: typography.weight) + } } diff --git a/SodaLive/Sources/UI/Theme/Color.swift b/SodaLive/Sources/UI/Theme/Color.swift index 433edb5..b64dea5 100644 --- a/SodaLive/Sources/UI/Theme/Color.swift +++ b/SodaLive/Sources/UI/Theme/Color.swift @@ -35,4 +35,38 @@ extension Color { static let mainRed2 = Color(hex: "ea3a25") static let mainRed3 = Color(hex: "dd4500") static let mainYellow = Color(hex: "ffdc00") + + static let soda50 = Color(hex: "E6F9FF") + static let soda100 = Color(hex: "B8EEFD") + static let soda200 = Color(hex: "85E1FB") + static let soda300 = Color(hex: "4FD2F9") + static let soda400 = Color(hex: "00BDF7") + static let soda500 = Color(hex: "00A0DF") + static let soda600 = Color(hex: "0081C2") + static let soda700 = Color(hex: "006BA4") + static let soda800 = Color(hex: "004F7F") + static let soda900 = Color(hex: "052742") + + static let red50 = Color(hex: "FFF1F2") + static let red100 = Color(hex: "FFD7D9") + static let red200 = Color(hex: "FFB3B7") + static let red300 = Color(hex: "FF858B") + static let red400 = Color(hex: "FF4C3C") + + static let green50 = Color(hex: "F5FBEF") + static let green100 = Color(hex: "E9FADB") + static let green200 = Color(hex: "C0F595") + static let green300 = Color(hex: "9FFB56") + static let green400 = Color(hex: "73FF01") + + static let gray50 = Color(hex: "FAFAFA") + static let gray100 = Color(hex: "F2F2F2") + static let gray200 = Color(hex: "E2E2E2") + static let gray300 = Color(hex: "CCCCCC") + static let gray400 = Color(hex: "B5B5B5") + static let gray500 = Color(hex: "959595") + static let gray600 = Color(hex: "787878") + static let gray700 = Color(hex: "494949") + static let gray800 = Color(hex: "343434") + static let gray900 = Color(hex: "202020") } diff --git a/SodaLive/Sources/UI/Theme/Radius.swift b/SodaLive/Sources/UI/Theme/Radius.swift new file mode 100644 index 0000000..94010cc --- /dev/null +++ b/SodaLive/Sources/UI/Theme/Radius.swift @@ -0,0 +1,12 @@ +// +// Radius.swift +// SodaLive +// + +import SwiftUI + +enum SodaRadius { + static let r4: CGFloat = 4 + static let r8: CGFloat = 8 + static let r14: CGFloat = 14 +} diff --git a/SodaLive/Sources/UI/Theme/Spacing.swift b/SodaLive/Sources/UI/Theme/Spacing.swift new file mode 100644 index 0000000..d3d65ea --- /dev/null +++ b/SodaLive/Sources/UI/Theme/Spacing.swift @@ -0,0 +1,20 @@ +// +// Spacing.swift +// SodaLive +// + +import SwiftUI + +enum SodaSpacing { + static let s4: CGFloat = 4 + static let s6: CGFloat = 6 + static let s8: CGFloat = 8 + static let s12: CGFloat = 12 + static let s14: CGFloat = 14 + static let s16: CGFloat = 16 + static let s20: CGFloat = 20 + static let s24: CGFloat = 24 + static let s28: CGFloat = 28 + static let s32: CGFloat = 32 + static let s48: CGFloat = 48 +}