From 097666237e40009a9780f3e8670f3ab66a7df500 Mon Sep 17 00:00:00 2001 From: baegteun Date: Thu, 22 Sep 2022 08:09:07 +0900 Subject: [PATCH] =?UTF-8?q?refactor=20::=20font=EC=9D=98=20size=EB=A5=BC?= =?UTF-8?q?=20=EC=A0=95=ED=95=98=EB=8A=94=20=EA=B2=83=EC=9D=84=20=EB=8D=94?= =?UTF-8?q?=EC=9A=B1=20protocol=20oriented=ED=95=98=EA=B2=8C.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Typography/DMSFontStyle.swift | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Projects/UsertInterfaces/DesignSystem/Sources/Typography/DMSFontStyle.swift b/Projects/UsertInterfaces/DesignSystem/Sources/Typography/DMSFontStyle.swift index 61f5641e..89ed4298 100644 --- a/Projects/UsertInterfaces/DesignSystem/Sources/Typography/DMSFontStyle.swift +++ b/Projects/UsertInterfaces/DesignSystem/Sources/Typography/DMSFontStyle.swift @@ -28,12 +28,15 @@ public enum DMSFontStyle { } } -// MARK: - Title -public extension DMSFontStyle.Title { +// MARK: - FontableSize +extension DMSFontable where Self: RawRepresentable, Self.RawValue == CGFloat { var size: CGFloat { self.rawValue } +} +// MARK: - Title +public extension DMSFontStyle.Title { var weight: Font.Weight { switch self { case .extraLarge, .large, .medium, .extraSmall: @@ -47,10 +50,6 @@ public extension DMSFontStyle.Title { // MARK: - Text public extension DMSFontStyle.Text { - var size: CGFloat { - self.rawValue - } - var weight: Font.Weight { switch self { case .twoExtraLarge, .extraLarge, .large, .medium, .small, .extraSmall, .twoExtraSmall: